2 ms·
How does it handle it when you add something to the middle of a file and every block afterwards has shifted data?
by pkaye 7y ago
How does it handle it when you add something to the middle of a file and every block afterwards has shifted data?
- MayeulC 7y agoI guess they probably use a rolling hash, that would be the smart thing to do. I think I first heard of them with casync. The gist of it is that you hash file contents in a sliding window, and use a condition on the resulting hash to chunck your file. That way, blocks are determined by the file content, not an arbitrary offset, and this allows to propagate deltas even with insertions or removals.
- chipsa 7y agoIf it's getting file change notifications, it can look at which blocks had changes written, and only do those. This doesn't help if every block has changes, but most programs that work on big files will have ways to minimize the number of blocks touched, simply to make it faster to save the file.