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 1554 of file GURL.cpp.

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

Referenced by cleardir().

{
  int retval = -1;
  if(is_local_file_url())
    {
#if defined(UNIX)
      if (is_dir())
        retval = ::rmdir(NativeFilename());
      else
        retval = ::unlink(NativeFilename());
#elif defined(WIN32)
      if (is_dir())
        retval = ::RemoveDirectoryA(NativeFilename());
      else
        retval = ::DeleteFile(NativeFilename());
#else
# error "Define something here for your operating system"
#endif
  }
  return retval;
}


Generated by  Doxygen 1.6.0   Back to index