Partager via


CAtlTemporaryFile Class

This class provides methods for the creation and use of a temporary file.

Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

class CAtlTemporaryFile

Members

Public Constructors

Name

Description

CAtlTemporaryFile::CAtlTemporaryFile

The constructor.

CAtlTemporaryFile::~CAtlTemporaryFile

The destructor.

Public Methods

Name

Description

CAtlTemporaryFile::Close

Call this method to close a temporary file and either delete its contents or store them under the specified file name.

CAtlTemporaryFile::Create

Call this method to create a temporary file.

CAtlTemporaryFile::Flush

Call this method to force any data remaining in the file buffer to be written to the temporary file.

CAtlTemporaryFile::GetPosition

Call this method to get the current file pointer position.

CAtlTemporaryFile::GetSize

Call this method to get the size in bytes of the temporary file.

CAtlTemporaryFile::HandsOff

Call this method to disassociate the file from the CAtlTemporaryFile object.

CAtlTemporaryFile::HandsOn

Call this method to open an existing temporary file and position the pointer at the end of the file.

CAtlTemporaryFile::LockRange

Call this method to lock a region in the file to prevent other processes from accessing it.

CAtlTemporaryFile::Read

Call this method to read data from the temporary file starting at the position indicated by the file pointer.

CAtlTemporaryFile::Seek

Call this method to move the file pointer of the temporary file.

CAtlTemporaryFile::SetSize

Call this method to set the size of the temporary file.

CAtlTemporaryFile::TempFileName

Call this method to return the name of the temporary file.

CAtlTemporaryFile::UnlockRange

Call this method to unlock a region of the temporary file.

CAtlTemporaryFile::Write

Call this method to write data to the temporary file starting at the position indicated by the file pointer.

Public Operators

Name

Description

CAtlTemporaryFile::operator HANDLE

Returns a handle to the temporary file.

Remarks

CAtlTemporaryFile makes it easy to create and use a temporary file. The file is automatically named, opened, closed, and deleted. If the file contents are required after the file is closed, they can be saved to a new file with a specified name.

Requirements

Header: atlfile.h

Example

See the example for CAtlTemporaryFile::CAtlTemporaryFile.

See Also

Reference

CAtlFile Class

Other Resources

ATL Class Overview