Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!xylogics!merk!spdcc!esegue!Postmaster From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.unix.sysv386 Subject: Re: ftruncate for System Vr3.2 Message-ID: <9009060047.AA23962@esegue.segue.boston.ma.us> Date: 6 Sep 90 04:47:52 GMT Sender: Postmaster@esegue.segue.boston.ma.us Organization: Segue Software Lines: 20 In article <1990Sep5.222350.6918@clark.eduyou write: >System V does not have ftruncate. But Xenix had the equivalent chsize(), so on Sys V/386 and its many descendants you can use it. The call: chsize(f, n); changes the size of the file open on descriptor f to be n. You can make a file larger or smaller, a zero n truncates the file. The file has to be open for writing. Chsize lives in the xenix library libx.a, so you need a -lx flag on your compile line. Note that this scores near zero in the portability department; I don't know what SVR4 does but would expect it to have the BSD ftruncate. Regards, John Levine, johnl@esegue.segue.boston.ma.us, {spdcc|ima|world}!esegue!johnl