Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
CFile::Rename
CFile                                       Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  static void Rename( const char* pszOldName, const char* pszNewName )
  throw( CFileException );
 
  Parameter    Description
 
  <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
 
 
 
                                     -♦-