darcs-2.11.0: a distributed, interactive, smart revision control system

Safe HaskellNone

Darcs.Util.File

Contents

Synopsis

Files and directories

OS-dependent special directories

xdgCacheDir :: IO (Maybe FilePath)

xdgCacheDir returns the $XDG_CACHE_HOME environment variable, or ~/.cache if undefined. See the FreeDesktop specification: http:standards.freedesktop.orgbasedir-specbasedir-spec-latest.html

osxCacheDir :: IO (Maybe FilePath)

osxCacheDir assumes ~LibraryCaches/ exists.

getDirectoryContents :: FilePath -> IO [FilePath]

getDirectoryContents dir returns a list of all entries in dir.

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]
  • isDoesNotExistError / NoSuchThing The directory does not exist. [ENOENT, ENOTDIR]
  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EACCES]
  • ResourceExhausted Insufficient resources are available to perform the operation. [EMFILE, ENFILE]
  • InappropriateType The path refers to an existing non-directory object. [ENOTDIR]

getRecursiveContents :: FilePath -> IO [FilePath]

getRecursiveContents returns all files under topdir that aren't directories.

getRecursiveContentsFullPath :: FilePath -> IO [FilePath]

getRecursiveContentsFullPath returns all files under topdir that aren't directories. Unlike getRecursiveContents this function returns the full path.