Paul Vojta wrote: > probably it would be a good idea to call fseek() and fflush() > before ftruncate(). Note that fflush() then fseek() on input streams behaves in an OS dependent way [1]. About fseek() then fflush(), I don't know. Bruno [1] https://www.gnu.org/software/gnulib/manual/html_node/fflush.html