PHP Manual: ftruncate
ftruncate
Description
bool ftruncate ( resource handle, int size )
Takes the filepointer, handle
, and truncates the file to
length, size
. Returns TRUE on success or FALSE on failure.
Note: The file pointer is changed only in append mode. In write mode, additional fseek() call is needed.