uniform-fileio-0.1.5.1: Uniform file handling operations
Safe HaskellSafe-Inferred
LanguageHaskell2010

Uniform.FileIO

Description

the basic file io - translated for the Either or ErrorT signaling style uses the Path and Path.IO framework

Synopsis

Documentation

getAppUserDataDir #

Arguments

:: MonadIO m 
=> String

Name of application (used in path construction)

-> m (Path Abs Dir) 

Obtain the path to a special directory for storing user-specific application data (traditional Unix location).

The argument is usually the name of the application. Since it will be integrated into the path, it must consist of valid path characters.

  • On Unix-like systems, the path is ~/.<app>.
  • On Windows, the path is %APPDATA%/<app> (e.g. C:/Users/<user>/AppData/Roaming/<app>)

Note: the directory may not actually exist, in which case you would need to create it. It is expected that the parent directory exists and is writable.

The operation may fail with:

  • UnsupportedOperation The operating system has no notion of application-specific data directory.
  • isDoesNotExistError The home directory for the current user does not exist, or cannot be found.

doesFileExist :: MonadIO m => Path b File -> m Bool #

The operation doesFileExist returns True if the argument file exists and is not a directory, and False otherwise.