Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!im4u!ut-sally!utah-cs!utah-gr!uplherc!nrc-ut!nrcvax!chris From: chris@nrcvax.UUCP Newsgroups: comp.unix.wizards Subject: Re: BSD to SysV Message-ID: <1249@nrcvax.UUCP> Date: Tue, 27-Oct-87 15:26:29 EST Article-I.D.: nrcvax.1249 Posted: Tue Oct 27 15:26:29 1987 Date-Received: Sun, 1-Nov-87 01:44:30 EST References: <9940@brl-adm.ARPA> <31892@sun.uucp> Reply-To: chris@minnie.UUCP (Chris Grevstad) Organization: Frobozo Items Co. Inc. Ltd. Lines: 19 guy%gorodish@Sun.COM (Guy Harris) says: >> Has anyone figured out how to perform the BSD functions ``fsync()'' >> and ``ftruncate()'' in System V? > >Unless you're truncating a file to zero length, you can't do "ftruncate()" >except by making a copy of the file up to the new length, doing a "creat" or >"open" with O_TRUNC to truncate the original file to zero length, and then >copying the truncated copy on top of the original file. This will give you truncate(), not ftruncate(), which requires a file descriptor, and if that's all you have, then you're in trouble. -- Chris Grevstad cit-vax!elroy!nrcvax!chris@rutgers.edu hplabs!sdcrdcf!psivax!nrcvax!chris ihnp4!nrcvax!chris Where subtlety fails us we must simply make do with cream pies.