Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 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