Truncating an open file under BSD 4.3

Root Boy Jim rbj at nav.icst.nbs.gov
Thu Jul 28 03:02:33 AEST 1988


? From: Badri Lokanathan <badri at valhalla.ee.rochester.edu>

? What is the best way to empty an already open write-only file under BSD 4.3?

Guy Harris answered most of your questions, so I won't repeat what he said...

? I tried truncate but it leaves holes in the file, which make
? it unreadable.

...but he didn't address this point. I find this hard to believe. Holes
are supposed to be read as blocks of zeros. Maybe you tried to read
after the truncate without changing the seek pointer?

? "We will fight for the right to be free {) badri at valhalla.ee.rochester.edu
?  We will build our own society         //\\ {ames,cmcl2,columbia,cornell,
?  And we will sing, we will sing       ///\\\ garp,harvard,ll-xn,rutgers}!
?  We will sing our own song."  -UB40    _||_   rochester!ur-valhalla!badri

	(Root Boy) Jim Cottrell	<rbj at icst-cmr.arpa>
	National Bureau of Standards
	Flamer's Hotline: (301) 975-5688
	The opinions expressed are solely my own
	and do not reflect NBS policy or agreement
	Careful with that VAX Eugene!



More information about the Comp.unix.questions mailing list