effectful-2.6.0.0: An easy to use, performant extensible effects library.
Safe HaskellNone
LanguageHaskell2010

Effectful.FileSystem

Synopsis

Effect

data FileSystem (a :: Type -> Type) b Source #

An effect for interacting with the filesystem.

Instances

Instances details
type DispatchOf FileSystem Source # 
Instance details

Defined in Effectful.FileSystem.Effect

data StaticRep FileSystem Source # 
Instance details

Defined in Effectful.FileSystem.Effect

Handlers

runFileSystem :: forall (es :: [Effect]) a. (HasCallStack, IOE :> es) => Eff (FileSystem ': es) a -> Eff es a Source #

Run the FileSystem effect.

Actions on directories

createDirectory :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es () Source #

removeDirectory :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es () Source #

removePathForcibly :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es () Source #

renameDirectory :: forall (es :: [Effect]). FileSystem :> es => FilePath -> FilePath -> Eff es () Source #

listDirectory :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es [FilePath] Source #

Current working directory

setCurrentDirectory :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es () Source #

withCurrentDirectory :: forall (es :: [Effect]) a. FileSystem :> es => FilePath -> Eff es a -> Eff es a Source #

Pre-defined directories

Actions on files

removeFile :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es () Source #

Lifted removeFile.

renameFile :: forall (es :: [Effect]). FileSystem :> es => FilePath -> FilePath -> Eff es () Source #

Lifted renameFile.

renamePath :: forall (es :: [Effect]). FileSystem :> es => FilePath -> FilePath -> Eff es () Source #

Lifted renamePath.

copyFile :: forall (es :: [Effect]). FileSystem :> es => FilePath -> FilePath -> Eff es () Source #

Lifted copyFile.

getFileSize :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es Integer Source #

Lifted getFileSize.

makeAbsolute :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es FilePath Source #

Lifted makeAbsolute.

Existence tests

doesPathExist :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es Bool Source #

doesFileExist :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es Bool Source #

findExecutable :: forall (es :: [Effect]). FileSystem :> es => String -> Eff es (Maybe FilePath) Source #

findExecutables :: forall (es :: [Effect]). FileSystem :> es => String -> Eff es [FilePath] Source #

findFile :: forall (es :: [Effect]). FileSystem :> es => [FilePath] -> String -> Eff es (Maybe FilePath) Source #

Lifted findFile.

findFiles :: forall (es :: [Effect]). FileSystem :> es => [FilePath] -> String -> Eff es [FilePath] Source #

Lifted findFiles.

findFileWith :: forall (es :: [Effect]). FileSystem :> es => (FilePath -> Eff es Bool) -> [FilePath] -> String -> Eff es (Maybe FilePath) Source #

Lifted findFileWith.

findFilesWith :: forall (es :: [Effect]). FileSystem :> es => (FilePath -> Eff es Bool) -> [FilePath] -> String -> Eff es [FilePath] Source #

Symbolic links

createFileLink :: forall (es :: [Effect]). FileSystem :> es => FilePath -> FilePath -> Eff es () Source #

createDirectoryLink :: forall (es :: [Effect]). FileSystem :> es => FilePath -> FilePath -> Eff es () Source #

removeDirectoryLink :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es () Source #

Permissions

setPermissions :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Permissions -> Eff es () Source #

copyPermissions :: forall (es :: [Effect]). FileSystem :> es => FilePath -> FilePath -> Eff es () Source #

Timestamps

getAccessTime :: forall (es :: [Effect]). FileSystem :> es => FilePath -> Eff es UTCTime Source #

setAccessTime :: forall (es :: [Effect]). FileSystem :> es => FilePath -> UTCTime -> Eff es () Source #

setModificationTime :: forall (es :: [Effect]). FileSystem :> es => FilePath -> UTCTime -> Eff es () Source #

Re-exports

Pre-defined directories

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.

XdgState

For data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in XdgData. It uses the XDG_STATE_HOME environment variable. On non-Windows sytems, the default is ~/.local/state. On Windows, the default is %LOCALAPPDATA% (e.g. C:/Users/<user>/AppData/Local).

Since: directory-1.3.7.0

Instances

Instances details
Bounded XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Enum 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

Eq XdgDirectory 
Instance details

Defined in System.Directory.Internal.Common

Ord 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

Read XdgDirectoryList 
Instance details

Defined in System.Directory.Internal.Common

Show 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

Existence tests

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

Permissions