Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!nsc!taux01!rick From: rick@taux01.UUCP (Rick Pelleg ) Newsgroups: comp.unix.questions Subject: emulating BSD "ftruncate" on SYSV Keywords: ftruncate Message-ID: <1305@taux01.UUCP> Date: 16 Mar 89 07:32:36 GMT Reply-To: rick@taux01.UUCP (Rick Pelleg ) Organization: National Semiconductor (IC) Ltd, Israel Lines: 28 Hello ye wizards. Can anyone help me with the following problem? Is it possible to emulate the BSDs system-call ftruncate(fd, length) int fd; off_t length; on UNIX SYS-V, Using anything available (library + system calls)? No, I DON'T have the name of the file... only a file pointer which I can convert to a file-descriptor using 'fileno()'. And please do not answer 'fp = fdopen(fileno(fp), "w")', as this will return a NEW file pointer (i.e., a new _iob entry). The old file pointer info will remain and be flushed when files are closed (e.g., by exit()). I am not a regular reader of this group, so please mail answers directly to me. I will summarize the interesting ones for the net. Thanks in advance -- --- Rick Pelleg National Semiconductor (Israel) 6 Maskit st. P.O.B. 3007, Herzlia 46104, Israel Tel. (972)52-522264 rick%taux01@nsc.com @{hplabs,pyramid,sun,decwrl}