Truncates a file to the specified length.
#include <unistd.h> int ftruncate ( int fildes, off_t len);
(IN) Specifies a file descriptor.
(IN) Specifies the length of the file.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
If the size of the file was previously smaller than the len parameter, the ftruncate function increases the size of the file to len, and zero fills the extended area.
If the ftruncate function fails, the file is unaffected.