[ truncate problem ]
Thanks for the answers, the solution was to open the standard output with O_APPEND, this is equivalent to ">>" on the command line.
-- mingo