Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
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
 
 
 
                                     -♦-