Extends or truncates the size of a file to the specified length.
#include <io.h> int chsize (int handle, long size);
handle
size
If the file is extended, null characters \0 are appended. If the file is truncated, all data from the end of the shortened file to the original length of the file is lost.
The directory update is done when a file is closed. Consequently, while a program is running, requests to determine the amount of freedisk space may receive inaccurate results.
EACCES | Specified file is locked against access. |
EBADF | Specified file is read-only or an invalid file descriptor. |
ENOSPC | No space is left on device. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/io.h | io.h | clib.lib |