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

Safe HaskellSafe
LanguageHaskell2010

UnliftIO.Directory

Contents

Description

Unlifted System.Directory.

Since: unliftio-0.2.6.0

Synopsis

Actions on directories

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

Lifted createDirectory.

Since: unliftio-0.2.6.0

createDirectoryIfMissing :: MonadIO m => Bool -> FilePath -> m () Source #

Lifted createDirectoryIfMissing.

Since: unliftio-0.2.6.0

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

Lifted removeDirectory.

Since: unliftio-0.2.6.0

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

Lifted removeDirectoryRecursive.

Since: unliftio-0.2.6.0

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

Lifted removePathForcibly.

Since: unliftio-0.2.6.0

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

Lifted renameDirectory.

Since: unliftio-0.2.6.0

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

Lifted listDirectory.

Since: unliftio-0.2.6.0

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

Lifted getDirectoryContents.

Since: unliftio-0.2.6.0

Current working directory

getCurrentDirectory :: MonadIO m => m FilePath Source #

Lifted getCurrentDirectory.

Since: unliftio-0.2.6.0

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

Lifted setCurrentDirectory.

Since: unliftio-0.2.6.0

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

Unlifted withCurrentDirectory.

Since: unliftio-0.2.6.0

Pre-defined directories

getHomeDirectory :: MonadIO m => m FilePath Source #

Lifted getHomeDirectory.

Since: unliftio-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

Enum XdgDirectory 
Instance details

Defined in System.Directory

Eq XdgDirectory 
Instance details

Defined in System.Directory

Ord XdgDirectory 
Instance details

Defined in System.Directory

Read XdgDirectory 
Instance details

Defined in System.Directory

Show XdgDirectory 
Instance details

Defined in System.Directory

getXdgDirectory :: MonadIO m => XdgDirectory -> FilePath -> m FilePath Source #

Lifted getXdgDirectory.

Since: unliftio-0.2.6.0

getTemporaryDirectory :: MonadIO m => m FilePath Source #

Lifted getTemporaryDirectory.

Since: unliftio-0.2.6.0

Actions on files

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

Lifted removeFile.

Since: unliftio-0.2.6.0

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

Lifted renameFile.

Since: unliftio-0.2.6.0

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

Lifted renamePath.

Since: unliftio-0.2.6.0

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

Lifted copyFile.

Since: unliftio-0.2.6.0

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

Lifted copyFileWithMetadata.

Since: unliftio-0.2.6.0

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

Lifted canonicalizePath.

Since: unliftio-0.2.6.0

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

Lifted makeAbsolute.

Since: unliftio-0.2.6.0

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

Lifted findExecutable.

Since: unliftio-0.2.6.0

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

Lifted findExecutables.

Since: unliftio-0.2.6.0

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

Lifted findFile.

Since: unliftio-0.2.6.0

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

Lifted findFiles.

Since: unliftio-0.2.6.0

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

Unlifted findFileWith.

Since: unliftio-0.2.6.0

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

Unlifted findFilesWith.

Since: unliftio-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: unliftio-0.2.6.0

Existence tests

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

Lifted doesPathExist.

Since: unliftio-0.2.6.0

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

Lifted doesFileExist.

Since: unliftio-0.2.6.0

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

Lifted doesDirectoryExist.

Since: unliftio-0.2.6.0

Symbolic links

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

Lifted pathIsSymbolicLink.

Since: unliftio-0.2.6.0

Permissions

getPermissions :: MonadIO m => FilePath -> m Permissions Source #

Lifted getPermissions.

Since: unliftio-0.2.6.0

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

Lifted setPermissions.

Since: unliftio-0.2.6.0

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

Lifted copyPermissions.

Since: unliftio-0.2.6.0

Timestamps

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

Lifted getAccessTime.

Since: unliftio-0.2.6.0

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

Lifted getModificationTime.

Since: unliftio-0.2.6.0

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

Lifted setAccessTime.

Since: unliftio-0.2.6.0

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

Lifted setModificationTime.

Since: unliftio-0.2.6.0