unliftio-0.2.22.0: The MonadUnliftIO typeclass for unlifting monads to IO (batteries included)
Safe HaskellSafe-Inferred
LanguageHaskell2010

UnliftIO.Directory

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

createFileLink Source #

Arguments

:: MonadIO m 
=> FilePath

path to the target file

-> FilePath

path of the link to be created

-> m () 

Lifted createFileLink. directory package version should be >= 1.3.1. @since 0.2.16.0

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

Lifted createDirectoryLink.

Since: 0.2.21.0

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

Lifted removeDirectoryLink.

Since: 0.2.21.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 usually map to the same directory.

Since: directory-1.2.3.0

Constructors

XdgData

For data files (e.g. images). It uses the XDG_DATA_HOME environment variable. On non-Windows systems, the default is ~/.local/share. On Windows, the default is %APPDATA% (e.g. C:/Users/<user>/AppData/Roaming). Can be considered as the user-specific equivalent of /usr/share.

XdgConfig

For configuration files. It uses the XDG_CONFIG_HOME environment variable. On non-Windows systems, the default is ~/.config. On Windows, the default 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). It uses the XDG_CACHE_HOME environment variable. On non-Windows systems, the default is ~/.cache. On Windows, the default is %LOCALAPPDATA% (e.g. C:/Users/<user>/AppData/Local). Can be considered as the user-specific equivalent of /var/cache.

Instances

Instances details
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

data XdgDirectoryList #

Search paths for various application data, as specified by the XDG Base Directory Specification.

The list of paths is split using searchPathSeparator, which on Windows is a semicolon.

Note: On Windows, XdgDataDirs and XdgConfigDirs usually yield the same result.

Since: directory-1.3.2.0

Constructors

XdgDataDirs

For data files (e.g. images). It uses the XDG_DATA_DIRS environment variable. On non-Windows systems, the default is /usr/local/share/ and /usr/share/. On Windows, the default is %PROGRAMDATA% or %ALLUSERSPROFILE% (e.g. C:/ProgramData).

XdgConfigDirs

For configuration files. It uses the XDG_CONFIG_DIRS environment variable. On non-Windows systems, the default is /etc/xdg. On Windows, the default is %PROGRAMDATA% or %ALLUSERSPROFILE% (e.g. C:/ProgramData).

Instances

Instances details
Bounded XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Enum XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Eq XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Ord XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Read XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Show XdgDirectoryList 
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