Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!oliveb!olivey!jerry From: jerry@olivey.olivetti.com (Jerry Aguirre) Newsgroups: comp.unix.questions Subject: Re: Truncating an open file under BSD 4.3 Keywords: Empty, !ftruncate, fcntl? Message-ID: <26556@oliveb.olivetti.com> Date: 2 Aug 88 19:50:24 GMT References: <1392@valhalla.ee.rochester.edu> <12684@mimsy.UUCP> Sender: news@oliveb.olivetti.com Reply-To: jerry@olivey.UUCP (Jerry Aguirre) Organization: Olivetti ATC; Cupertino, Ca Lines: 15 In article <12684@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: > > open > write (moves seek pointer) > ftruncate > write > >will create holes, since the second `write' is not at the beginning What is interesting is that even if the open file has been placed in FAPPEND mode there will still be holes. I view this as a bug. FAPPEND is defined as possitioning each write at the end of the file, even if some other process has changed where the end is located. Certainly truncating a file to zero length should be considered changing where the file ends. Jerry Aguirre