O'Reilly logo
  • Ivan Petrov thinks this is interesting:

On its own, seeking past the end of a file does nothing—a read request to the newly created file position will return EOF. If a write request is subsequently made to this position, however, new space will be created between the old length of the file and the new length, and it will be padded with zeros.


Cover of Linux System Programming


seeking and writing past the end of file