truncating open files in C under Xe

tif at cpe.UUCP tif at cpe.UUCP
Fri Sep 16 09:19:00 AEST 1988


Written  2:15 am  Sep 15, 1988 by mimsy.UUCP!chris in cpe:comp.unix.xenix
>In article <171 at uniblab.UUCP> al at uniblab.UUCP (alan krantz) asks:
>>If i have an open file and want to set that files length
>>to zero, do i have to close the file and reopen it?
>In article <12175 at oberon.USC.EDU> english at stromboli.usc.edu (Joe English)
>>Can't be done; you do have to close() and re- creat() or 
>>open(... | O_TRUNC).
>Well, actually, while you do have to call creat, or open with O_TRUNC,
>you need not close the file.  (If you have 4.2BSD or something later,
>you can use ftrucate, but then the Subject line did say `Xenix'.)

Isn't chsize() a standard function?  It's in Xenix's library as well
as MS-DOS's.

			Paul Chamberlain
			Computer Product Engineering, Tandy Corp.
			{convex,killer}!ninja!cpe!tif



More information about the Comp.unix.xenix mailing list