Q: truncate, does it work?

Ingo Molnar (mingo@pc5829.hil.siemens.co.at)
Tue, 27 Feb 1996 15:44:03 +0100 (MET)


Consider the following scenario:

1) Process A is created with standard output redirected to file F
2) Process A writes 1000 bytes to the standard output. (to F)
3) Process B truncates this file to zero lenght, with "truncate( path, 0 )"
4) Process A writes to the standard output another 1000 bytes

Now the file is 2000 bytes long, and the first 1000 bytes are filled up
with zeroes. Is it intended to be this way?

What i'd like to have is to "log" the standard output, and truncate it
sometimes.

Thanks for your insight,

-- Copyright 1996. Ingo Molnar, mingo@hercules.elte.hu, Microsoft Network is
prohibited from redistributing this work in any form, in whole or
in partwithout license. License to distribute this work is available to
Microsoft at $500. Transmission without permission constitutes an agreement
to these terms. Make money fast! Copy this signature :))