3 ms·
I'm curious why it writes the whole file... Can't you do something like: if rollback log exists recover create log for each write(),
by dicroce 9y ago
I'm curious why it writes the whole file... Can't you do something like:
if rollback log exists
recover
create log
for each write(),
write old contents of region to log (along w/ location)
sync log
for each write(),
write new bits
sync db file
remove(log)
- jeffreyrogers 9y agoThat is probably a better approach for large files. My initial use case was an application that would write an encrypted file containing passwords to disk. The files are relatively small, so that method didn't seem worth the additional complexity of something like what you describe. I believe sqlite does something similar at least in some configurations. I might add something like this in the future.