SimpleH-1.0.1: A light, clean and powerful Haskell utility library

Safe HaskellNone

SimpleH.File

Contents

Synopsis

Exported modules

module SimpleH

The File interface

data File Source

Instances

getCurrentDirectory :: IO FilePath

If the operating system has a notion of current directories, getCurrentDirectory returns an absolute path to the current directory of the calling process.

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • isDoesNotExistError / NoSuchThing There is no path referring to the current directory. [EPERM, ENOENT, ESTALE...]
  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EACCES]
  • ResourceExhausted Insufficient resources are available to perform the operation.
  • UnsupportedOperation The operating system has no notion of current directory.

Note that in a concurrent program, the current directory is global state shared between all threads of the process. When using filesystem operations from multiple threads, it is therefore highly recommended to use absolute rather than relative FilePaths.