Logo Search packages:      
Sourcecode: djvulibre version File versions

int GURL::deletefile ( void   )  const

Deletes file or directory. Directories are not deleted unless the directory is empty. Returns a negative number if an error occurs.

Definition at line 1564 of file GURL.cpp.

References is_dir(), is_local_file_url(), and NativeFilename().

Referenced by cleardir(), and DjVuDocEditor::~DjVuDocEditor().

{
  int retval=(-1);
  if(is_local_file_url())
  {
#ifdef WIN32
    USES_CONVERSION;
    retval=is_dir()
      ?RemoveDirectory(A2CT(NativeFilename()))
      :DeleteFile(A2CT(NativeFilename())); //MBCS cvt
#else
    retval=is_dir()
      ?rmdir(NativeFilename())
      :unlink(NativeFilename());//MBCS cvt
#endif
  }
  return retval;
}


Generated by  Doxygen 1.6.0   Back to index