CFile::SetStatus

static void SetStatus( LPCTSTR lpszFileName, const CFileStatus& status );
throw( CFileException );

Parameters

lpszFileName

A string that is the path to the desired file. The path can be relative or absolute but cannot contain a network name.

status

The buffer containing the new status information. Call the GetStatus member function to prefill the CFileStatus structure with current values, then make changes as required. If a value is 0, then the corresponding status item is not updated. See the GetStatus member function for a description of the CFileStatus structure.

Remarks

Sets the status of the file associated with this file location.

To set the time, modify the m_mtime field of status.

Please note that when you make a call to SetStatus in an attempt to change only the attributes of the file, and the m_mtime member of the file status structure is nonzero, the attributes may also be affected (changing the time stamp may have side effects on the attributes). If you want to only change the attributes of the file, first set the m_mtime member of the file status structure to zero and then make a call to SetStatus.

Example

//example for CFile::SetStatus
char* pFileName = "test.dat";
extern BYTE newAttribute;
CFileStatus status;
CFile::GetStatus( pFileName, status );
status.m_attribute = newAttribute;
CFile::SetStatus( pFileName, status );

CFile OverviewClass MembersHierarchy Chart

See Also   CFile::GetStatus