🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #5561

Re: File truncation under PC-DOS

#5561
From: rde
Date: Tue, 04 Feb 1986 09:08
17 lines
1206 bytes
In article <901@dataioDataio.UUCP> bright@dataio.UUCP writes:
>Anyone out there know a way to truncate a file to 'n' bytes in
>length (without going in and directly manipulating the FAT)? I
>need a method that is 'well-behaved'.
>
Use  function  42H (seek) to move the file pointer to the place you want
the file truncated. Then use function 40H (write) with a count  of  zero
(CX=0). This  comes  from the MS-DOS Programmer's Manual so it ought (!)
to be well behaved.  Hope this helps.
-- 
           Bob Eager

           rde@ukc.UUCP
           rde@ukc
           ...!mcvax!ukc!rde

           Phone: +44 227 66822 ext 7589
Technical Details
Message-ID: <685@eagle.ukc.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!mcvax!ukc!rde
References: <901@dataioDataio.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!mcvax!ukc!rde
From: rde@ukc.UUCP
Newsgroups: net.micro.pc
Subject: Re: File truncation under PC-DOS
Message-ID: <685@eagle.ukc.ac.uk>
Date: Tue, 4-Feb-86 04:08:02 EST
Article-I.D.: eagle.685
Posted: Tue Feb  4 04:08:02 1986
Date-Received: Fri, 7-Feb-86 09:24:06 EST
References: <901@dataioDataio.UUCP>
Reply-To: rde@ukc.UUCP (R.D.Eager)
Organization: U of Kent at Canterbury, Canterbury, UK
Lines: 17