Word description Set the length of the file to n bytes. If the file was previously longer, the extra data is lost. If the file was previously shorter, the behavior is platform-dependent on whether the file is extended with zeros (Unix) or the contents of the extended portion are undefined (Windows).
Errors Throws an error if the file does not exist or the truncate operation fails.