Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
chsize
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The chsize function extends or truncates the file associated with
<handle> to the length specified by <size>. The file must be open
in a mode that permits writing. Null characters (\0) are appended
if the file is extended. If the file is truncated, all data from
the end of the shortened file to the original length of the file
is lost.
In DOS, the directory update is done when a file is closed.
Consequently, while a program is running, requests to determine
the amount of free disk space may receive inaccurate results.
Return Value
The chsize function returns the value 0 if the file size is
successfully changed. A return value of -1 indicates an error, and
errno is set to EACCES, EBADF, or ENOSPC.
-♦-