Truncating an open file under BSD 4.3

Jerry Aguirre jerry at olivey.olivetti.com
Wed Aug 3 05:50:24 AEST 1988


In article <12684 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>
>	open
>	write (moves seek pointer)
>	ftruncate
>	write
>
>will create holes, since the second `write' is not at the beginning

What is interesting is that even if the open file has been placed in
FAPPEND mode there will still be holes.  I view this as a bug.  FAPPEND
is defined as possitioning each write at the end of the file, even if
some other process has changed where the end is located.  Certainly
truncating a file to zero length should be considered changing where the
file ends.
					Jerry Aguirre



More information about the Comp.unix.questions mailing list