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!ut-sally!pyramid!hplabs!hp-pcd!bill From: bill@hp-pcd.UUCP Newsgroups: net.micro.pc Subject: Re: File truncation under PC-DOS Message-ID: <15200010@hpcvlo.UUCP> Date: Wed, 5-Feb-86 12:52:00 EST Article-I.D.: hpcvlo.15200010 Posted: Wed Feb 5 12:52:00 1986 Date-Received: Tue, 11-Feb-86 03:41:14 EST References: <901@dataioDa.UUCP> Organization: Hewlett-Packard - Corvallis, OR Lines: 15 Nf-ID: #R:dataioDa:-90100:hpcvlo:15200010:000:413 Nf-From: hpcvlo!bill Feb 5 09:52:00 1986 Truncating a file to 'n' bytes is fairly easy: [1] Open the file for read/write access using Int 21h function 3Dh. [2] Use Int 21h function 42h to position the file pointer to position 'n'. [3] Truncate the file at that point by using Int 21h function 40h (Write to File or Device) with a byte count of zero in CX. [4] Close the file using Int 21h function 3Eh (or 4Ch). bill frolik hplabs!hp-pcd!bill