SetSize


The SetSize method changes file size.
C++
long SetSize(
  long FileSize              // file size
);
BASIC
SetSize(
  FileSize As Long           // file size
) As Long

Parameters

FileSize
File size in bytes.

Return Values

If the method succeeds, the return value is 0.
If the method fails, the return value is failure code and error code is set. Call GetError to get error code.

Remarks

FileSize always specifies physical size of the file - on successfull completion size of the file is exactly FileSize bytes. Unsaved data present in internal buffer is flushed to the file prior to changing its size. Method can be used for both increasing and decreasing size of the file.

See Also

GetSize, Expand, Shrink, Changing File Size