4 ms·
So if I prepend 17 bytes to a file, where are they stored? And if I prepend another 47 bytes, etc.? How would this be tracked?
by tedunangst 2y ago
So if I prepend 17 bytes to a file, where are they stored? And if I prepend another 47 bytes, etc.? How would this be tracked?
- kbolino 2y agoSame as going forward, you'd grab a free block and simply fill it backwards from the end instead of forwards from the beginning. But the file system would have to support file data starting mid-block and new blocks getting added to the head of the file. The problem is that there'd be more bookkeeping data to store, more code to implement it, and more edge cases to handle for concurrent writes.
- tedunangst 2y agoThat'd be hell for mmap, too.
- Joker_vD 2y agoUnironically, I think it'd be easier for purely mmap-based API to support such scenarios.