CFile::SetLength

Syntax

virtual void SetLength( const DWORD dwNewLen )
throw( CFileException );

Parameters

dwNewLen

Desired length of the file in bytes. This value may be larger or smaller than the current length of the file. The file will be extended or truncated as appropriate.

Remarks

Changes the length of the file.

Note:

With CMemFile, this function could throw a CMemoryException object.

Example

extern CFile cfile;

DWORD dwNewLength = 10000;

cfile.SetLength( dwNewLength );