chsize()

Changes a file's size.

  #include <extras/extras_io.h>
  
  int chsize(int handle, long size);    
Parameter

handle

The handle of the file being changed.

size

The size to change to.

Remarks

If a file is truncated all data beyond the new end of file is lost. If a file is extended, the function fills the extended area of the file with null characters ( '\0' ). This function returns zero on success and -1 if a failure occurs.

This facility is not specified in the ISO/IEC standards. It is an EWL extension of the standard libraries.

This facility may not be available on some configurations of the EWL.