Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!utgpu!lewan From: lewan@gpu.utcs.toronto.edu (S. Lewandowsky) Newsgroups: comp.sys.ibm.pc Subject: Truncating MS-DOS files Message-ID: <1987Feb15.123004.21019@gpu.utcs.toronto.edu> Date: Sun, 15-Feb-87 12:30:04 EST Article-I.D.: gpu.1987Feb15.123004.21019 Posted: Sun Feb 15 12:30:04 1987 Date-Received: Sun, 15-Feb-87 18:37:13 EST Organization: University of Toronto Computing Services Lines: 9 Checksum: 43023 How can I truncate a file using DOS? For example, I may open a file, write to it and read from it extensively, and as a result its size --when I use the close file handle call--would be about 120K or greater. However, I only want to save the first 10K of that file, so I'd like to place the file pointer to whereever I want the file to end, and then truncate it so that the information beyond the pointer is discarded and the file size is reduced to 10K. There is a truncate procedure in Turbo Pascal, so there must be a way of doing it--but how do I do it in an ASM program using INT 21H?