unliftio-0.2.13: The MonadUnliftIO typeclass for unlifting monads to IO (batteries included)

Safe HaskellSafe
LanguageHaskell2010

UnliftIO.Directory

Contents

Description

Unlifted System.Directory.

Since: 0.2.6.0

Synopsis

Actions on directories

createDirectory :: MonadIO m => FilePath -> m () Source #

Lifted createDirectory.

Since: 0.2.6.0

removeDirectory :: MonadIO m => FilePath -> m () Source #

Lifted removeDirectory.

Since: 0.2.6.0

removePathForcibly :: MonadIO m => FilePath -> m () Source #

Lifted removePathForcibly.

Since: 0.2.6.0

renameDirectory :: MonadIO m => FilePath -> FilePath -> m () Source #

Lifted renameDirectory.

Since: 0.2.6.0

listDirectory :: MonadIO m => FilePath -> m [FilePath] Source #

Lifted listDirectory.

Since: 0.2.6.0

Current working directory

setCurrentDirectory :: MonadIO m => FilePath -> m () Source #

Lifted setCurrentDirectory.

Since: 0.2.6.0

withCurrentDirectory :: MonadUnliftIO m => FilePath -> m a -> m a Source #

Unlifted withCurrentDirectory.

Since: 0.2.6.0

Pre-defined directories

getHomeDirectory :: MonadIO m => m FilePath Source #

Lifted getHomeDirectory.

Since: 0.2.6.0

data XdgDirectory #

Special directories for storing user-specific application data, configuration, and cache files, as specified by the XDG Base Directory Specification.

Note: On Windows, XdgData and XdgConfig map to the same directory.

Since: directory-1.2.3.0

Constructors

XdgData

For data files (e.g. images). Defaults to ~/.local/share and can be overridden by the XDG_DATA_HOME environment variable. On Windows, it is %APPDATA% (e.g. C:/Users/<user>/AppData/Roaming). Can be considered as the user-specific equivalent of /usr/share.

XdgConfig

For configuration files. Defaults to ~/.config and can be overridden by the XDG_CONFIG_HOME environment variable. On Windows, it is %APPDATA% (e.g. C:/Users/<user>/AppData/Roaming). Can be considered as the user-specific equivalent of /etc.

XdgCache

For non-essential files (e.g. cache). Defaults to ~/.cache and can be overridden by the XDG_CACHE_HOME environment variable. On Windows, it is %LOCALAPPDATA% (e.g. C:/Users/<user>/AppData/Local). Can be considered as the user-specific equivalent of /var/cache.

Instances
Bounded XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Enum XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Eq XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Ord XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Read XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Show XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Actions on files

removeFile :: MonadIO m => FilePath -> m () Source #

Lifted removeFile.

Since: 0.2.6.0

renameFile :: MonadIO m => FilePath -> FilePath -> m () Source #

Lifted renameFile.

Since: 0.2.6.0

renamePath :: MonadIO m => FilePath -> FilePath -> m () Source #

Lifted renamePath.

Since: 0.2.6.0

copyFile :: MonadIO m => FilePath -> FilePath -> m () Source #

Lifted copyFile.

Since: 0.2.6.0

makeAbsolute :: MonadIO m => FilePath -> m FilePath Source #

Lifted makeAbsolute.

Since: 0.2.6.0

findExecutable :: MonadIO m => String -> m (Maybe FilePath) Source #

Lifted findExecutable.

Since: 0.2.6.0

findExecutables :: MonadIO m => String -> m [FilePath] Source #

Lifted findExecutables.

Since: 0.2.6.0

findFile :: MonadIO m => [FilePath] -> String -> m (Maybe FilePath) Source #

Lifted findFile.

Since: 0.2.6.0

findFiles :: MonadIO m => [FilePath] -> String -> m [FilePath] Source #

Lifted findFiles.

Since: 0.2.6.0

findFileWith :: MonadUnliftIO m => (FilePath -> m Bool) -> [FilePath] -> String -> m (Maybe FilePath) Source #

Unlifted findFileWith.

Since: 0.2.6.0

findFilesWith :: MonadUnliftIO m => (FilePath -> m Bool) -> [FilePath] -> String -> m [FilePath] Source #

Unlifted findFilesWith.

Since: 0.2.6.0

exeExtension :: String #

Filename extension for executable files (including the dot if any) (usually "" on POSIX systems and ".exe" on Windows or OS/2).

Since: directory-1.2.4.0

getFileSize :: MonadIO m => FilePath -> m Integer Source #

Lifted getFileSize.

Since: 0.2.6.0

Existence tests

doesPathExist :: MonadIO m => FilePath -> m Bool Source #

Lifted doesPathExist.

Since: 0.2.6.0

doesFileExist :: MonadIO m => FilePath -> m Bool Source #

Lifted doesFileExist.

Since: 0.2.6.0

Symbolic links

Permissions

setPermissions :: MonadIO m => FilePath -> Permissions -> m () Source #

Lifted setPermissions.

Since: 0.2.6.0

copyPermissions :: MonadIO m => FilePath -> FilePath -> m () Source #

Lifted copyPermissions.

Since: 0.2.6.0

Timestamps

getAccessTime :: MonadIO m => FilePath -> m UTCTime Source #

Lifted getAccessTime.

Since: 0.2.6.0

setAccessTime :: MonadIO m => FilePath -> UTCTime -> m () Source #

Lifted setAccessTime.

Since: 0.2.6.0

setModificationTime :: MonadIO m => FilePath -> UTCTime -> m () Source #

Lifted setModificationTime.

Since: 0.2.6.0