🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #2933

Re: Where is my Fshrink() GEMDOS call ?

#2933
From: Leo de Wit
Date: Mon, 07 Aug 1989 18:42
24 lines
1515 bytes
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.
Technical Details
Message-ID: <1063@philmds.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!pacbell!ames!lll-winken!uunet!mcvax!hp4nl!phigate!philmds!leo
References: <667@electro.UUCP> <638@opal.tubopal.UUCP> <2951@ukecc.engr.uky.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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