Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!tut.cis.ohio-state.edu!rutgers!bellcore!tness7!ninja!cpe!tif From: tif@cpe.UUCP Newsgroups: comp.unix.xenix Subject: Re: truncating open files in C under Xe Message-ID: <6800035@cpe> Date: 15 Sep 88 23:19:00 GMT References: <13571@mimsy.UUCP> Lines: 17 Nf-ID: #R:mimsy.UUCP:13571:cpe:6800035:000:804 Nf-From: cpe.UUCP!tif Sep 15 18:19:00 1988 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