CFile::Rename

Syntax

static void Rename( const char* pszOldName, const char* pszNewName )
throw( CFileException );

Parameters

pszOldName

The old path.

pszNewName

The new path.

Remarks

This static function renames the specified file. Directories cannot be renamed. This is equivalent to the MS-DOS ren command.

Example

extern char* pOldName;

extern char* pNewName;

TRY

{

CFile::Rename( pOldName, pNewName );

}

CATCH( CFileException, e )

{

#ifdef _DEBUG

afxDump << "File " << pOldName << " not found, cause = "

<< e->m_cause << "\\n";

#endif

}

END_CATCH