Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
CFile::Remove
CFile                                       Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  static void Remove( const char* pszFileName )
  throw( CFileException );
 
  Parameter     Description
 
  <pszFileName> A string that is the path to the desired file. The path
                may be relative or absolute, but may not contain a network
                name.
 
  Remarks
 
  This static function deletes the file specified by the path. It will not
  remove a directory.
 
  The Remove member function throws an exception if the connected file is
  open or if the file cannot be removed. This is equivalent to the MS-DOS
  del command.
 
  Example
 
  char* pFileName = "test.dat";
  TRY
  {
      CFile::Remove( pFileName );
  }
  CATCH( CFileException, e )
  {
    #ifdef _DEBUG
       afxDump << "File " << pFileName << " cannot be removed\n";
    #endif
  }
  END_CATCH
 
 
 
                                     -♦-