directory-1.3.8.5: Platform-agnostic library for filesystem operations

Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

System.Directory.Internal

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.

Synopsis

- data FileType
  - = File
  - | SymbolicLink
  - | Directory
  - | DirectoryLink
- os :: String -> OsString
- data OsString
- type OsPath = OsString
- data XdgDirectory
  - = XdgData
  - | XdgConfig
  - | XdgCache
  - | XdgState
- data XdgDirectoryList
  - = XdgDataDirs
  - | XdgConfigDirs
- data Permissions = Permissions {
  - readable :: Bool
  - writable :: Bool
  - executable :: Bool
  - searchable :: Bool
  }
- newtype ListT (m :: Type -> Type) a = ListT {
  - unListT :: m (Maybe (a, ListT m a))
  }
- emptyListT :: forall (m :: Type -> Type) a. Applicative m => ListT m a
- maybeToListT :: Applicative m => m (Maybe a) -> ListT m a
- listToListT :: forall (m :: Type -> Type) a. Applicative m => [a] -> ListT m a
- liftJoinListT :: Monad m => m (ListT m a) -> ListT m a
- listTHead :: Functor m => ListT m a -> m (Maybe a)
- listTToList :: Monad m => ListT m a -> m [a]
- andM :: Monad m => m Bool -> m Bool -> m Bool
- sequenceWithIOErrors_ :: [IO ()] -> IO ()
- tryIOErrorType :: (IOError -> Bool) -> IO a -> IO (Either IOError a)
- ignoreIOExceptions :: IO () -> IO ()
- specializeErrorString :: String -> (IOError -> Bool) -> IO a -> IO a
- ioeAddLocation :: IOError -> String -> IOError
- rightOrError :: Exception e => Either e a -> a
- so :: OsString -> String
- ioeSetOsPath :: IOError -> OsPath -> IOError
- expandDots :: [OsPath] -> [OsPath]
- normalisePathSeps :: OsPath -> OsPath
- normaliseTrailingSep :: OsPath -> OsPath
- emptyToCurDir :: OsPath -> OsPath
- simplifyPosix :: OsPath -> OsPath
- simplifyWindows :: OsPath -> OsPath
- fileTypeIsDirectory :: FileType -> Bool
- fileTypeIsLink :: FileType -> Bool
- withBinaryHandle :: IO Handle -> (Handle -> IO r) -> IO r
- copyHandleData :: Handle -> Handle -> IO ()
- setFileMode :: OsPath -> Mode -> IO ()
- createSymbolicLink :: Bool -> OsPath -> OsPath -> IO ()
- readSymbolicLink :: OsPath -> IO OsPath
- createDirectoryInternal :: OsPath -> IO ()
- removePathInternal :: Bool -> OsPath -> IO ()
- renamePathInternal :: OsPath -> OsPath -> IO ()
- filesAlwaysRemovable :: Bool
- simplify :: OsPath -> OsPath
- c_free :: Ptr a -> IO ()
- c_PATH_MAX :: Maybe Int
- c_realpath :: CString -> CString -> IO CString
- withRealpath :: CString -> (CString -> IO a) -> IO a
- realPath :: OsPath -> IO OsPath
- canonicalizePathSimplify :: OsPath -> IO OsPath
- findExecutablesLazyInternal :: ([OsPath] -> OsString -> ListT IO OsPath) -> OsString -> ListT IO OsPath
- getPath :: IO [OsPath]
- exeExtensionInternal :: OsString
- getDirectoryContentsInternal :: OsPath -> IO [OsPath]
- getCurrentDirectoryInternal :: IO OsPath
- prependCurrentDirectory :: OsPath -> IO OsPath
- setCurrentDirectoryInternal :: OsPath -> IO ()
- linkToDirectoryIsDirectory :: Bool
- createHardLink :: OsPath -> OsPath -> IO ()
- type Metadata = FileStatus
- getSymbolicLinkMetadata :: OsPath -> IO Metadata
- getFileMetadata :: OsPath -> IO Metadata
- fileTypeFromMetadata :: Metadata -> FileType
- fileSizeFromMetadata :: Metadata -> Integer
- accessTimeFromMetadata :: Metadata -> UTCTime
- modificationTimeFromMetadata :: Metadata -> UTCTime
- type Mode = FileMode
- modeFromMetadata :: Metadata -> Mode
- allWriteMode :: FileMode
- hasWriteMode :: Mode -> Bool
- setWriteMode :: Bool -> Mode -> Mode
- setFilePermissions :: OsPath -> Mode -> IO ()
- getAccessPermissions :: OsPath -> IO Permissions
- setAccessPermissions :: OsPath -> Permissions -> IO ()
- copyOwnerFromStatus :: FileStatus -> OsPath -> IO ()
- copyGroupFromStatus :: FileStatus -> OsPath -> IO ()
- tryCopyOwnerAndGroupFromStatus :: FileStatus -> OsPath -> IO ()
- defaultFlags :: OpenFileFlags
- openFileForRead :: OsPath -> IO Handle
- openFileForWrite :: OsPath -> IO Handle
- copyFileContents :: OsPath -> OsPath -> IO ()
- copyFileWithMetadataInternal :: (Metadata -> OsPath -> IO ()) -> (Metadata -> OsPath -> IO ()) -> OsPath -> OsPath -> IO ()
- setTimes :: OsPath -> (Maybe POSIXTime, Maybe POSIXTime) -> IO ()
- lookupEnvOs :: OsString -> IO (Maybe OsString)
- getEnvOs :: OsString -> IO OsString
- getHomeDirectoryInternal :: IO OsPath
- getXdgDirectoryFallback :: IO OsPath -> XdgDirectory -> IO OsPath
- getXdgDirectoryListFallback :: XdgDirectoryList -> IO [OsPath]
- getAppUserDataDirectoryInternal :: OsPath -> IO OsPath
- getUserDocumentsDirectoryInternal :: IO OsPath
- getTemporaryDirectoryInternal :: IO OsPath

# Documentation

data FileType Source #

Constructors

File |
SymbolicLink | POSIX: either file or directory link; Windows: file link
Directory |
DirectoryLink | Windows only: directory link

#### Instances

Instances details

Bounded FileType Source # |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: FileType # maxBound :: FileType #
Enum FileType Source # |
Instance details Defined in System.Directory.Internal.Common Methods succ :: FileType -> FileType # pred :: FileType -> FileType # toEnum :: Int -> FileType # fromEnum :: FileType -> Int # enumFrom :: FileType -> [FileType] # enumFromThen :: FileType -> FileType -> [FileType] # enumFromTo :: FileType -> FileType -> [FileType] # enumFromThenTo :: FileType -> FileType -> FileType -> [FileType] #
Read FileType Source # |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS FileType # readList :: ReadS [FileType] # readPrec :: ReadPrec FileType # readListPrec :: ReadPrec [FileType] #
Show FileType Source # |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> FileType -> ShowS # show :: FileType -> String # showList :: [FileType] -> ShowS #
Eq FileType Source # |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: FileType -> FileType -> Bool # (/=) :: FileType -> FileType -> Bool #
Ord FileType Source # |
Instance details Defined in System.Directory.Internal.Common Methods compare :: FileType -> FileType -> Ordering # (<) :: FileType -> FileType -> Bool # (<=) :: FileType -> FileType -> Bool # (>) :: FileType -> FileType -> Bool # (>=) :: FileType -> FileType -> Bool # max :: FileType -> FileType -> FileType # min :: FileType -> FileType -> FileType #

os :: String -> OsString Source #

Fallibly converts String to OsString. Only intended to be used on literals.

data OsString Source #

Newtype representing short operating system specific strings.

Internally this is either `WindowsString` or `PosixString`, depending on the platform. Both use unpinned `ShortByteString` for efficiency.

The constructor is only exported via System.OsString.Internal.Types, since dealing with the internals isn't generally recommended, but supported in case you need to write platform specific code.

#### Instances

Instances details

NFData OsString |
Instance details Defined in System.OsString.Internal.Types Methods rnf :: OsString -> ()
Monoid OsString | "String-Concatenation" for `OsString`. This is not the same as `(</>)`.
Instance details Defined in System.OsString.Internal.Types Methods mempty :: OsString # mappend :: OsString -> OsString -> OsString # mconcat :: [OsString] -> OsString #
Semigroup OsString |
Instance details Defined in System.OsString.Internal.Types Methods (<>) :: OsString -> OsString -> OsString # sconcat :: NonEmpty OsString -> OsString # stimes :: Integral b => b -> OsString -> OsString #
Generic OsString |

Instance details

Defined in System.OsString.Internal.Types

Associated Types

type Rep OsString |
Instance details Defined in System.OsString.Internal.Types type Rep OsString = D1 ('MetaData "OsString" "System.OsString.Internal.Types" "os-string-2.0.7-bb8c" 'True) (C1 ('MetaCons "OsString" 'PrefixI 'True) (S1 ('MetaSel ('Just "getOsString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlatformString)))

Methods

from :: OsString -> Rep OsString x #

to :: Rep OsString x -> OsString #

Show OsString | On windows, decodes as UCS-2. On unix prints the raw bytes without decoding.
Instance details Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> OsString -> ShowS # show :: OsString -> String # showList :: [OsString] -> ShowS #
Eq OsString | Byte equality of the internal representation.
Instance details Defined in System.OsString.Internal.Types Methods (==) :: OsString -> OsString -> Bool # (/=) :: OsString -> OsString -> Bool #
Ord OsString | Byte ordering of the internal representation.
Instance details Defined in System.OsString.Internal.Types Methods compare :: OsString -> OsString -> Ordering # (<) :: OsString -> OsString -> Bool # (<=) :: OsString -> OsString -> Bool # (>) :: OsString -> OsString -> Bool # (>=) :: OsString -> OsString -> Bool # max :: OsString -> OsString -> OsString # min :: OsString -> OsString -> OsString #
Lift OsString |
Instance details Defined in System.OsString.Internal.Types Methods lift :: Quote m => OsString -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => OsString -> Code m OsString
type Rep OsString |
Instance details Defined in System.OsString.Internal.Types type Rep OsString = D1 ('MetaData "OsString" "System.OsString.Internal.Types" "os-string-2.0.7-bb8c" 'True) (C1 ('MetaCons "OsString" 'PrefixI 'True) (S1 ('MetaSel ('Just "getOsString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlatformString)))

type OsPath = OsString Source #

Type representing filenames/pathnames.

This type doesn't add any guarantees over `OsString`.

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` 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 Source # |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: XdgDirectory # maxBound :: XdgDirectory #
Enum XdgDirectory Source # |

Instance details

Defined in System.Directory.Internal.Common

Methods

succ :: XdgDirectory -> XdgDirectory #

pred :: XdgDirectory -> XdgDirectory #

toEnum :: Int -> XdgDirectory #

fromEnum :: XdgDirectory -> Int #

enumFrom :: XdgDirectory -> [XdgDirectory] #

enumFromThen :: XdgDirectory -> XdgDirectory -> [XdgDirectory] #

enumFromTo :: XdgDirectory -> XdgDirectory -> [XdgDirectory] #

enumFromThenTo :: XdgDirectory -> XdgDirectory -> XdgDirectory -> [XdgDirectory] #

Read XdgDirectory Source # |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS XdgDirectory # readList :: ReadS [XdgDirectory] # readPrec :: ReadPrec XdgDirectory # readListPrec :: ReadPrec [XdgDirectory] #
Show XdgDirectory Source # |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> XdgDirectory -> ShowS # show :: XdgDirectory -> String # showList :: [XdgDirectory] -> ShowS #
Eq XdgDirectory Source # |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: XdgDirectory -> XdgDirectory -> Bool # (/=) :: XdgDirectory -> XdgDirectory -> Bool #
Ord XdgDirectory Source # |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectory -> XdgDirectory -> Ordering #

(<) :: XdgDirectory -> XdgDirectory -> Bool #

(<=) :: XdgDirectory -> XdgDirectory -> Bool #

(>) :: XdgDirectory -> XdgDirectory -> Bool #

(>=) :: XdgDirectory -> XdgDirectory -> Bool #

max :: XdgDirectory -> XdgDirectory -> XdgDirectory #

min :: XdgDirectory -> XdgDirectory -> XdgDirectory #

data XdgDirectoryList Source #

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 Source # |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: XdgDirectoryList # maxBound :: XdgDirectoryList #
Enum XdgDirectoryList Source # |

Instance details

Defined in System.Directory.Internal.Common

Methods

succ :: XdgDirectoryList -> XdgDirectoryList #

pred :: XdgDirectoryList -> XdgDirectoryList #

toEnum :: Int -> XdgDirectoryList #

fromEnum :: XdgDirectoryList -> Int #

enumFrom :: XdgDirectoryList -> [XdgDirectoryList] #

enumFromThen :: XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList] #

enumFromTo :: XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList] #

enumFromThenTo :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList] #

Read XdgDirectoryList Source # |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS XdgDirectoryList # readList :: ReadS [XdgDirectoryList] # readPrec :: ReadPrec XdgDirectoryList # readListPrec :: ReadPrec [XdgDirectoryList] #
Show XdgDirectoryList Source # |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> XdgDirectoryList -> ShowS # show :: XdgDirectoryList -> String # showList :: [XdgDirectoryList] -> ShowS #
Eq XdgDirectoryList Source # |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: XdgDirectoryList -> XdgDirectoryList -> Bool # (/=) :: XdgDirectoryList -> XdgDirectoryList -> Bool #
Ord XdgDirectoryList Source # |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectoryList -> XdgDirectoryList -> Ordering #

(<) :: XdgDirectoryList -> XdgDirectoryList -> Bool #

(<=) :: XdgDirectoryList -> XdgDirectoryList -> Bool #

(>) :: XdgDirectoryList -> XdgDirectoryList -> Bool #

(>=) :: XdgDirectoryList -> XdgDirectoryList -> Bool #

max :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList #

min :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList #

data Permissions Source #

Constructors

Permissions |

Fields

- readable :: Bool
- writable :: Bool
- executable :: Bool
- searchable :: Bool

#### Instances

Instances details

Read Permissions Source # |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS Permissions # readList :: ReadS [Permissions] # readPrec :: ReadPrec Permissions # readListPrec :: ReadPrec [Permissions] #
Show Permissions Source # |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> Permissions -> ShowS # show :: Permissions -> String # showList :: [Permissions] -> ShowS #
Eq Permissions Source # |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: Permissions -> Permissions -> Bool # (/=) :: Permissions -> Permissions -> Bool #
Ord Permissions Source # |
Instance details Defined in System.Directory.Internal.Common Methods compare :: Permissions -> Permissions -> Ordering # (<) :: Permissions -> Permissions -> Bool # (<=) :: Permissions -> Permissions -> Bool # (>) :: Permissions -> Permissions -> Bool # (>=) :: Permissions -> Permissions -> Bool # max :: Permissions -> Permissions -> Permissions # min :: Permissions -> Permissions -> Permissions #

newtype ListT (m :: Type -> Type) a Source #

A generator with side-effects.

Constructors

ListT |

Fields

- unListT :: m (Maybe (a, ListT m a))

emptyListT :: forall (m :: Type -> Type) a. Applicative m => ListT m a Source #

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

listToListT :: forall (m :: Type -> Type) a. 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 #

rightOrError :: Exception e => Either e a -> a Source #

so :: OsString -> String Source #

Fallibly converts OsString to String. Only intended to be used on literals.

ioeSetOsPath :: IOError -> OsPath -> IOError Source #

expandDots :: [OsPath] -> [OsPath] Source #

Given a list of path segments, expand `.` and `..`. The path segments must not contain path separators.

normalisePathSeps :: OsPath -> OsPath Source #

Convert to the right kind of slashes.

normaliseTrailingSep :: OsPath -> OsPath Source #

Remove redundant trailing slashes and pick the right kind of slash.

emptyToCurDir :: OsPath -> OsPath Source #

Convert empty paths to the current directory, otherwise leave it unchanged.

simplifyPosix :: OsPath -> OsPath Source #

Similar to `normalise` but empty paths stay empty.

simplifyWindows :: OsPath -> OsPath Source #

Similar to `normalise` but:

- empty paths stay empty,
- parent dirs (`..`) are expanded, and
- paths starting with `\\?\` are preserved.

The goal is to preserve the meaning of paths better than `normalise`.

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.

withBinaryHandle :: IO Handle -> (Handle -> IO r) -> IO r Source #

copyHandleData Source #

Arguments

:: Handle | Source handle
-> Handle | Destination handle
-> IO () |

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

setFileMode :: OsPath -> Mode -> IO () Source #

createSymbolicLink :: Bool -> OsPath -> OsPath -> IO () Source #

readSymbolicLink :: OsPath -> IO OsPath Source #

createDirectoryInternal :: OsPath -> IO () Source #

removePathInternal :: Bool -> OsPath -> IO () Source #

renamePathInternal :: OsPath -> OsPath -> IO () Source #

filesAlwaysRemovable :: Bool Source #

simplify :: OsPath -> OsPath Source #

On POSIX, equivalent to `simplifyPosix`.

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 #

realPath :: OsPath -> IO OsPath Source #

canonicalizePathSimplify :: OsPath -> IO OsPath Source #

findExecutablesLazyInternal :: ([OsPath] -> OsString -> ListT IO OsPath) -> OsString -> ListT IO OsPath Source #

getPath :: IO [OsPath] Source #

Get the contents of the `PATH` environment variable.

exeExtensionInternal :: OsString Source #

getDirectoryContentsInternal :: OsPath -> IO [OsPath] Source #

getCurrentDirectoryInternal :: IO OsPath Source #

prependCurrentDirectory :: OsPath -> IO OsPath Source #

Convert a path into an absolute path. If the given path is relative, the current directory is prepended and the path may or may not be simplified. 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 throw exceptions.

Empty paths are treated as the current directory.

setCurrentDirectoryInternal :: OsPath -> IO () Source #

linkToDirectoryIsDirectory :: Bool Source #

createHardLink :: OsPath -> OsPath -> IO () Source #

type Metadata = FileStatus Source #

getSymbolicLinkMetadata :: OsPath -> IO Metadata Source #

getFileMetadata :: OsPath -> IO Metadata Source #

fileTypeFromMetadata :: Metadata -> FileType Source #

fileSizeFromMetadata :: Metadata -> Integer Source #

accessTimeFromMetadata :: Metadata -> UTCTime Source #

modificationTimeFromMetadata :: Metadata -> UTCTime Source #

type Mode = FileMode Source #

modeFromMetadata :: Metadata -> Mode Source #

allWriteMode :: FileMode Source #

hasWriteMode :: Mode -> Bool Source #

setWriteMode :: Bool -> Mode -> Mode Source #

setFilePermissions :: OsPath -> Mode -> IO () Source #

getAccessPermissions :: OsPath -> IO Permissions Source #

setAccessPermissions :: OsPath -> Permissions -> IO () Source #

copyOwnerFromStatus :: FileStatus -> OsPath -> IO () Source #

copyGroupFromStatus :: FileStatus -> OsPath -> IO () Source #

tryCopyOwnerAndGroupFromStatus :: FileStatus -> OsPath -> IO () Source #

defaultFlags :: OpenFileFlags Source #

openFileForRead :: OsPath -> IO Handle Source #

openFileForWrite :: OsPath -> IO Handle Source #

copyFileContents Source #

Arguments

:: OsPath | Source filename
-> OsPath | 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.

copyFileWithMetadataInternal :: (Metadata -> OsPath -> IO ()) -> (Metadata -> OsPath -> IO ()) -> OsPath -> OsPath -> IO () Source #

setTimes :: OsPath -> (Maybe POSIXTime, Maybe POSIXTime) -> IO () Source #

lookupEnvOs :: OsString -> IO (Maybe OsString) Source #

getEnvOs :: OsString -> IO OsString Source #

getHomeDirectoryInternal :: IO OsPath Source #

$HOME is preferred, because the user has control over it. However, POSIX doesn't define it as a mandatory variable, so fall back to `getpwuid_r`.

getXdgDirectoryFallback :: IO OsPath -> XdgDirectory -> IO OsPath Source #

getXdgDirectoryListFallback :: XdgDirectoryList -> IO [OsPath] Source #

getAppUserDataDirectoryInternal :: OsPath -> IO OsPath Source #

getUserDocumentsDirectoryInternal :: IO OsPath Source #

getTemporaryDirectoryInternal :: IO OsPath Source #