Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!accuvax.nwu.edu!tank!shamash!nic.MR.NET!hal!ncoast!allbery From: allbery@ncoast.ORG (Brandon S. Allbery) Newsgroups: comp.unix.wizards Subject: Re: How can a file be truncated on System V?? Message-ID: <13619@ncoast.ORG> Date: 6 May 89 16:43:07 GMT References: <651@mitisft.Convergent.COM> <887@twwells.uucp> Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 30 As quoted from <887@twwells.uucp> by bill@twwells.uucp (T. William Wells): +--------------- | In article <651@mitisft.Convergent.COM> kemnitz@mitisft.Convergent.COM (Gregory Kemnitz) writes: | : There is an ULTRIX (I think) function | : | : ftruncate(fd, length) | : int fd, length; | | (Actually, BSD) | | You don't do it with a standard system call. I once had occasion to | look long and hard for this and didn't find it. +--------------- Standard System V (except perhaps 3.2) doesn't have this. Xenix System V may use one of two methods: (1) zero-length write at point of truncation (2) a system call whose name I've forgotten which truncates the file at the current lseek() position SysV 3.2 probably uses the latter method. I can look up the syscall if you're desperate. ++Brandon -- Brandon S. Allbery, moderator of comp.sources.misc allbery@ncoast.org uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu Send comp.sources.misc submissions to comp-sources-misc@ NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser