Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!twwells!bill From: bill@twwells.uucp (T. William Wells) Newsgroups: comp.unix.wizards Subject: Re: How can a file be truncated on System V?? Keywords: link, unlink, directory Message-ID: <887@twwells.uucp> Date: 29 Apr 89 20:16:44 GMT References: <651@mitisft.Convergent.COM> Reply-To: bill@twwells.UUCP (T. William Wells) Organization: None, Ft. Lauderdale Lines: 20 Summary: Expires: Sender: Followup-To: Distribution: 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) : 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?? 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. --- Bill { uunet | novavax } !twwells!bill