3 ms·
> It's just gluing two files together, it's got to be a very popular operation, about as popular as "prepend the contents of file A to file B". Realistically I
by lmm 2y ago
> It's just gluing two files together, it's got to be a very popular operation, about as popular as "prepend the contents of file A to file B".
Realistically I don't think that's going to happen very often. What would be the use case? The only case I can think of is something like tar where you pack up a bunch of files as a single file, and you usually do compression at the same time in that case.
- Joker_vD 2y ago> What would be the use case? Every time you need to extend the length of the field in the middle of your data (e.g., increase a variable-length-field in the header). Many file formats resort to trailer chunks specifically because of that (see ID3v2 of MP3 files, or ZIP). Or think about how SQLite's on-disk file format uses freelist of file pages: it's literally an embryonic file system in itself, built on top of the existing one. Or hey — what about linking object files together? It's kind of like the merge sort, since you need to re-slice text/data/misc and then re-glue them. Traditional linkers would create several temporary files for each combined section and then merge those files together.