Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site luke.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!oliveb!bene!luke!steven From: steven@luke.UUCP (Steven List) Newsgroups: net.unix-wizards Subject: Re: truncating a file opened via open() Message-ID: <217@luke.UUCP> Date: Thu, 13-Jun-85 15:30:08 EDT Article-I.D.: luke.217 Posted: Thu Jun 13 15:30:08 1985 Date-Received: Mon, 17-Jun-85 08:23:43 EDT References: <340@cmu-cs-edu1.ARPA> <786@turtlevax.UUCP> Reply-To: steven@luke.UUCP (Steven List) Organization: Uncle Bene's Farm Lines: 18 In article <786@turtlevax.UUCP> ken@turtlevax.UUCP (Ken Turkowski) writes: >In article <340@cmu-cs-edu1.ARPA> hua@cmu-cs-edu1.ARPA (Ernest Hua) writes: >>Does anyone have any idea how to truncate a file at the current point in >>writing if it is opened by open()? > >size = lseek(fd, 0L, 1); /* tell(fd) */ >ftruncate(fd, size); /* int fd, size; */ > >It's yet another undocumented feature on 4.2. OK, how about System III? That's my problem. Someone out there posted a program that uses ftruncate, and we don't have it. Solutions are welcome! -- *** * Steven List @ Benetics Corporation * (415) 940-6300 * {cdp,greipa,idi,oliveb,sun,tolerant}!bene!luke!steven ***