[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
Part1 - Part2 - Part3 - Single Page
Top Document: x86 Assembly Language FAQ - General Part 1/3
Previous Document: 6. What Is HELPPC and Where Is It Available
Next Document: 8. How Can STDERR Be Redirected To A File
-
Search the FAQ Archives
Part1 - Part2 - Part3 - Single Page
Top Document: x86 Assembly Language FAQ - General Part 1/3
Previous Document: 6. What Is HELPPC and Where Is It Available
Next Document: 8. How Can STDERR Be Redirected To A File
7. How To Truncate A File
There is not any single DOS Int 21h function that performs this
operation. A file can be truncated using two functions. The procedure
is:
1. Use Int 21h function 42h, Move File Pointer, to move the file
pointer to the position where you want the file to be truncated.
2. Use Int 21h function 40h, Write File or Device, to write zero bytes
to the file.
Execution of the last DOS function will update the directory to the new
file length.
Contributor: Raymond Moon, raymoon@moonware.dgsys.com
Last changed: 28 Dec 94
Top Document: x86 Assembly Language FAQ - General Part 1/3
Previous Document: 6. What Is HELPPC and Where Is It Available
Next Document: 8. How Can STDERR Be Redirected To A File
Part1 - Part2 - Part3 - Single Page
[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
Send corrections/additions to the FAQ Maintainer:
raymoon@moonware.dgsys.com
Last Update October 22 2009 @ 05:22 AM