C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
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
─────Run-Time Library───────────────────────────────────────────────────────
 
     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 and Windows, 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.
                                    -♦-