[comp.unix.xenix] truncating open files in C under Xe

tif@cpe.UUCP (09/16/88)

Written  2:15 am  Sep 15, 1988 by mimsy.UUCP!chris in cpe:comp.unix.xenix
>In article <171@uniblab.UUCP> al@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@oberon.USC.EDU> english@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

iv@hal6000.UUCP (09/17/88)

>> 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.

Nope.  It's something that Microsoft added (and caused a bug, long ago).
Anyway, that's why you'll find it in libx.a instead of libc.a.
----
IV  (aka John Elliott IV)	 Domain: iv@hal6000.Tandy.COM
Tandy Systems Software		   UUCP: ...!killer!ninja!hal6000!iv
1300 Two Tandy Center		     or: ...!decvax!microsoft!trsvax!hal6000!iv
Fort Worth, TX 76102		  Phone: 817/390-2701; 9:30am-6:00pm CST