Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Inserting

Name: Anonymous 2009-09-03 7:48

are there any open/write functions for C , which do not overwrite chars in a file , but insert them ?

or do i have to write a shitty loop that just reads , stores and writes a char ?

also discuss file and string handling libraries because most that i have seen suck .

Name: Anonymous 2009-09-03 11:26

>>17
Extents have 3 parts (in ext4 at least): logical position inside the file, length, physical block (you need all this data for random access to extents, and also to allow for stuff like sparse files). You'd need to add 12 bits (for 4K blocks) to "logical position inside the file" and another 12 bits to "length", converting these to bytes instead of blocks, and you're done.

It'd hurt performance, of course, but consider it's the same with sparse files (and also filesystem-level compression). The only new thing is that you'd lose block-level alignment, but that's not too bad. It'd be a new tool to use. Systems that need it now (databases come to mind) just reimplement their own filesystem-inside-file and are paying the cost already, with their own fragmentation and internal free lists.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List