Banging my head against sparse files

Lately I’ve had use for sparse files to solve a problem. Simple, yes. Use lseek and write (or read). Even better, at least in this case, use pwrite and pread. Should be simple, right? Yes, should be. I was banging my head against code equivalent to the following for quite a few hours: #define _XOPEN_SOURCE …

Continue reading ‘Banging my head against sparse files’ »