Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!oliveb!pyramid!ctnews!mitisft!kemnitz From: kemnitz@mitisft.Convergent.COM (Gregory Kemnitz) Newsgroups: comp.unix.wizards Subject: How can a file be truncated on System V?? Summary: I only have a write-only file descriptor Keywords: link, unlink, directory Message-ID: <651@mitisft.Convergent.COM> Date: 28 Apr 89 18:04:47 GMT Organization: Convergent Technologies, San Jose, CA Lines: 14 There is an ULTRIX (I think) function ftruncate(fd, length) int fd, length; that takes a file pointed at by fd and truncates the file to length bytes. The file descriptor may be only open for writing (which rules out dumping length bytes to a temporary file and copying them back, which involves read access). How would one implement such a function in System V (I have tried the obvious ways, ie fcntl(), etc). Do you have to write something to edit the inode to do this?? --Greg