Path: utzoo!utgpu!attcan!uunet!husc6!rutgers!rochester!ur-tut!ur-valhalla!badri From: badri@valhalla.ee.rochester.edu (Badri Lokanathan) Newsgroups: comp.unix.questions Subject: Re: Truncating an open file under BSD 4.3 Summary: Found the correct solution .. Keywords: Empty, !ftruncate, fcntl? Message-ID: <1396@valhalla.ee.rochester.edu> Date: 27 Jul 88 17:57:47 GMT References: <1392@valhalla.ee.rochester.edu> Organization: UR Dept. of Electrical Engg, Rochester NY 14627 Lines: 17 In article <1392@valhalla.ee.rochester.edu>, I wrote: > What is the best way to empty an already open write-only file under BSD 4.3? > ... > 3/110.) I tried truncate but it leaves holes in the file, which make > it unreadable. Thanks to all who posted the right solution (fflush-ftruncate-lseek) This was exactly what I had planned to check out; unfortunately I coded my test program incorrectly (never code just before dinner time :-) causing strange things to happen. Hoping sys V has some equivalent form of ftruncate .... -- "Don't blame me for wanting more {) badri@valhalla.ee.rochester.edu The facts are too hard to ignore //\\ {ames,cmcl2,columbia,cornell, I'm scared to death of poverty ///\\\ garp,harvard,ll-xn,rutgers}! I only want what's best for me."-UB40 /\ rochester!ur-valhalla!badri