Поделиться через


CFile::SetLength

Call this function to change the length of the file.

virtual void SetLength(
   ULONGLONG dwNewLen 
);

Параметры

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

Заметки

ПримечаниеПримечание.

With CMemFile, this function could throw a CMemoryException object.

Пример

CFile cfile;
cfile.Open(_T("SetLength_File.dat"), CFile::modeCreate |
   CFile::modeReadWrite);
ULONGLONG dwNewLength = 10000;
cfile.SetLength(dwNewLength);

Требования

Header: afx.h

См. также

Основные понятия

CFile Class

CFile Members

Hierarchy Chart