W3cubDocs

/Haskell 8

System.Directory.Internal

Stability unstable
Portability unportable
Safe Haskell Safe
Language Haskell2010

Description

Internal modules are always subject to change from version to version. The contents of this module are also platform-dependent, hence what is shown in the Hackage documentation may differ from what is actually available on your system.

newtype ListT m a Source

A generator with side-effects.

Constructors

ListT

Fields

emptyListT :: Applicative m => ListT m a Source

maybeToListT :: Applicative m => m (Maybe a) -> ListT m a Source

listToListT :: Applicative m => [a] -> ListT m a Source

liftJoinListT :: Monad m => m (ListT m a) -> ListT m a Source

listTHead :: Functor m => ListT m a -> m (Maybe a) Source

listTToList :: Monad m => ListT m a -> m [a] Source

andM :: Monad m => m Bool -> m Bool -> m Bool Source

sequenceWithIOErrors_ :: [IO ()] -> IO () Source

tryIOErrorType :: (IOError -> Bool) -> IO a -> IO (Either IOError a) Source

Similar to try but only catches a specify kind of IOError as specified by the predicate.

ignoreIOExceptions :: IO () -> IO () Source

Attempt to perform the given action, silencing any IO exception thrown by it.

specializeErrorString :: String -> (IOError -> Bool) -> IO a -> IO a Source

ioeAddLocation :: IOError -> String -> IOError Source

data FileType Source

Constructors

File
SymbolicLink

POSIX: either file or directory link; Windows: file link

Directory
DirectoryLink

Windows only: directory link

Instances
Bounded FileType
Instance details

Defined in System.Directory.Internal.Common

Enum FileType
Instance details

Defined in System.Directory.Internal.Common

Eq FileType
Instance details

Defined in System.Directory.Internal.Common

Methods

(==) :: FileType -> FileType -> Bool

(/=) :: FileType -> FileType -> Bool

Ord FileType
Instance details

Defined in System.Directory.Internal.Common

Read FileType
Instance details

Defined in System.Directory.Internal.Common

Show FileType
Instance details

Defined in System.Directory.Internal.Common

fileTypeIsDirectory :: FileType -> Bool Source

Check whether the given FileType is considered a directory by the operating system. This affects the choice of certain functions e.g. removeDirectory vs removeFile.

fileTypeIsLink :: FileType -> Bool Source

Return whether the given FileType is a link.

data Permissions Source

Constructors

Permissions

prependCurrentDirectoryWith :: IO FilePath -> FilePath -> IO FilePath Source

Convert a path into an absolute path. If the given path is relative, the current directory is prepended. If the path is already absolute, the path is returned unchanged. The function preserves the presence or absence of the trailing path separator.

If the path is already absolute, the operation never fails. Otherwise, the operation may fail with the same exceptions as getCurrentDirectory.

(internal API)

copyFileContents Source

Arguments

:: FilePath

Source filename

-> FilePath

Destination filename

-> IO ()

Truncate the destination file and then copy the contents of the source file to the destination file. If the destination file already exists, its attributes shall remain unchanged. Otherwise, its attributes are reset to the defaults.

copyFileToHandle Source

Arguments

:: FilePath

Source file

-> Handle

Destination handle

-> IO ()

Copy all data from a file to a handle.

copyHandleData Source

Arguments

:: Handle

Source handle

-> Handle

Destination handle

-> IO ()

Copy data from one handle to another until end of file.

data XdgDirectory Source

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

data XdgDirectoryList Source

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

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

Since: directory-1.3.2.0

Constructors

XdgDataDirs

For data files (e.g. images). Defaults to usrlocalshare and usrshare/ and can be overridden by the XDG_DATA_DIRS environment variable. On Windows, it is %PROGRAMDATA% or %ALLUSERSPROFILE% (e.g. C:/ProgramData).

XdgConfigDirs

For configuration files. Defaults to etcxdg and can be overridden by the XDG_CONFIG_DIRS environment variable. On Windows, it is %PROGRAMDATA% or %ALLUSERSPROFILE% (e.g. C:/ProgramData).

Instances
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

createDirectoryInternal :: FilePath -> IO () Source

removePathInternal :: Bool -> FilePath -> IO () Source

renamePathInternal :: FilePath -> FilePath -> IO () Source

c_free :: Ptr a -> IO () Source

c_PATH_MAX :: Maybe Int Source

c_realpath :: CString -> CString -> IO CString Source

withRealpath :: CString -> (CString -> IO a) -> IO a Source

canonicalizePathWith :: ((FilePath -> IO FilePath) -> FilePath -> IO FilePath) -> FilePath -> IO FilePath Source

canonicalizePathSimplify :: FilePath -> IO FilePath Source

findExecutablesLazyInternal :: ([FilePath] -> String -> ListT IO FilePath) -> String -> ListT IO FilePath Source

exeExtensionInternal :: String Source

getDirectoryContentsInternal :: FilePath -> IO [FilePath] Source

getCurrentDirectoryInternal :: IO FilePath Source

prependCurrentDirectory :: FilePath -> IO FilePath Source

setCurrentDirectoryInternal :: FilePath -> IO () Source

linkToDirectoryIsDirectory :: Bool Source

createSymbolicLink :: Bool -> FilePath -> FilePath -> IO () Source

readSymbolicLink :: FilePath -> IO FilePath Source

type Metadata = FileStatus Source

getSymbolicLinkMetadata :: FilePath -> IO Metadata Source

getFileMetadata :: FilePath -> IO Metadata Source

fileTypeFromMetadata :: Metadata -> FileType Source

fileSizeFromMetadata :: Metadata -> Integer Source

accessTimeFromMetadata :: Metadata -> UTCTime Source

modificationTimeFromMetadata :: Metadata -> UTCTime Source

posix_accessTimeHiRes :: FileStatus -> POSIXTime Source

posix_modificationTimeHiRes :: FileStatus -> POSIXTime Source

type Mode = FileMode Source

modeFromMetadata :: Metadata -> Mode Source

allWriteMode :: FileMode Source

hasWriteMode :: Mode -> Bool Source

setWriteMode :: Bool -> Mode -> Mode Source

setFileMode :: FilePath -> Mode -> IO () Source

setFilePermissions :: FilePath -> Mode -> IO () Source

getAccessPermissions :: FilePath -> IO Permissions Source

setAccessPermissions :: FilePath -> Permissions -> IO () Source

copyOwnerFromStatus :: FileStatus -> FilePath -> IO () Source

copyGroupFromStatus :: FileStatus -> FilePath -> IO () Source

tryCopyOwnerAndGroupFromStatus :: FileStatus -> FilePath -> IO () Source

copyFileWithMetadataInternal :: (Metadata -> FilePath -> IO ()) -> (Metadata -> FilePath -> IO ()) -> FilePath -> FilePath -> IO () Source

setTimes :: FilePath -> (Maybe POSIXTime, Maybe POSIXTime) -> IO () Source

getPath :: IO [FilePath] Source

Get the contents of the PATH environment variable.

getHomeDirectoryInternal :: IO FilePath Source

getXdgDirectoryInternal :: IO FilePath -> XdgDirectory -> IO FilePath Source

getXdgDirectoryListInternal :: XdgDirectoryList -> IO [FilePath] Source

getAppUserDataDirectoryInternal :: FilePath -> IO FilePath Source

getUserDocumentsDirectoryInternal :: IO FilePath Source

getTemporaryDirectoryInternal :: IO FilePath Source

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.6.1/docs/html/libraries/directory-1.3.3.0/System-Directory-Internal.html