Path: utzoo!utgpu!watmath!att!pacbell!ames!lll-winken!uunet!mcvax!hp4nl!phigate!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.sys.atari.st Subject: Re: Where is my Fshrink() GEMDOS call ? Message-ID: <1063@philmds.UUCP> Date: 7 Aug 89 18:42:31 GMT References: <667@electro.UUCP> <638@opal.tubopal.UUCP> <2951@ukecc.engr.uky.edu> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 24 In article <2951@ukecc.engr.uky.edu> agollum@engr.uky.edu (Kenneth Herron) writes: |I don't have an ST myself, but in MS-DOS you accomplish this by |seeking to the desired position and issuing a write of 0 characters. |It's worth a try... | |Kenneth Herron Alas, it won't work, or better: fortunately. If such a stupid system design had been made, you had to check all your ordinary writes for zero-length writes, perhaps by writing a wrapper for Fwrite(). This really ought to be a separate system call a la BSD fruncate() (now I remember System V Unix also did something special with zero-length writes, but memory fades here). The file's length won't be affected (using Fopen with either mode 1 - writeonly - or 2 - read/write). And if you issue a write of > 0 characters, those characters will replace the ones already there in the file. There is one situation in which you can truncate a file, that is to length zero (using the Fcreate call). This is faster than explicit removing the file first (so my documentation says). Leo.