Share via


CFile Members

Base Class Members

CObject Members

Data Members

m_hFile

Usually contains the operating-system file handle.

CFile::hFileNull

Determines if the CFile object has a valid handle.

Operators

operator HANDLE

A handle to a CFile object.

Construction

Abort

Closes a file ignoring all warnings and errors.

CFile

Constructs a CFile object from a path or file handle.

Close

Closes a file and deletes the object.

Duplicate

Constructs a duplicate object based on this file.

Open

Safely opens a file with an error-testing option.

Input/Output

Flush

Flushes any data yet to be written.

Read

Reads (unbuffered) data from a file at the current file position.

Write

Writes (unbuffered) data in a file to the current file position.

Position

GetLength

Retrieves the length of the file.

Seek

Positions the current file pointer.

SeekToBegin

Positions the current file pointer at the beginning of the file.

SeekToEnd

Positions the current file pointer at the end of the file.

SetLength

Changes the length of the file.

Locking

LockRange

Locks a range of bytes in a file.

UnlockRange

Unlocks a range of bytes in a file.

Status

GetFileName

Retrieves the filename of the selected file.

GetFilePath

Retrieves the full file path of the selected file.

GetFileTitle

Retrieves the title of the selected file.

GetPosition

Retrieves the current file pointer.

GetStatus

Retrieves the status of this open file.

SetFilePath

Sets the full file path of the selected file.

Static

GetStatus

Retrieves the status of the specified file (static, virtual function).

Remove

Deletes the specified file (static function).

Rename

Renames the specified file (static function).

SetStatus

Sets the status of the specified file (static, virtual function).

See Also

Reference

CFile Class

Hierarchy Chart