| Stability | unstable |
|---|---|
| Portability | unportable |
| Safe Haskell | Safe |
| 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
- newtype ListT m a = ListT {}
- emptyListT :: Applicative m => ListT m a
- maybeToListT :: Applicative m => m (Maybe a) -> ListT m a
- listToListT :: 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
- data FileType
- fileTypeIsDirectory :: FileType -> Bool
- fileTypeIsLink :: FileType -> Bool
- data Permissions = Permissions {
- readable :: Bool
- writable :: Bool
- executable :: Bool
- searchable :: Bool
- prependCurrentDirectoryWith :: IO FilePath -> FilePath -> IO FilePath
- copyFileContents :: FilePath -> FilePath -> IO ()
- copyFileToHandle :: FilePath -> Handle -> IO ()
- copyHandleData :: Handle -> Handle -> IO ()
- data XdgDirectory
- data XdgDirectoryList
- createDirectoryInternal :: FilePath -> IO ()
- removePathInternal :: Bool -> FilePath -> IO ()
- renamePathInternal :: FilePath -> FilePath -> IO ()
- c_free :: Ptr a -> IO ()
- c_PATH_MAX :: Maybe Int
- c_realpath :: CString -> CString -> IO CString
- withRealpath :: CString -> (CString -> IO a) -> IO a
- canonicalizePathWith :: ((FilePath -> IO FilePath) -> FilePath -> IO FilePath) -> FilePath -> IO FilePath
- canonicalizePathSimplify :: FilePath -> IO FilePath
- findExecutablesLazyInternal :: ([FilePath] -> String -> ListT IO FilePath) -> String -> ListT IO FilePath
- exeExtensionInternal :: String
- getDirectoryContentsInternal :: FilePath -> IO [FilePath]
- getCurrentDirectoryInternal :: IO FilePath
- prependCurrentDirectory :: FilePath -> IO FilePath
- setCurrentDirectoryInternal :: FilePath -> IO ()
- linkToDirectoryIsDirectory :: Bool
- createSymbolicLink :: Bool -> FilePath -> FilePath -> IO ()
- readSymbolicLink :: FilePath -> IO FilePath
- type Metadata = FileStatus
- getSymbolicLinkMetadata :: FilePath -> IO Metadata
- getFileMetadata :: FilePath -> IO Metadata
- fileTypeFromMetadata :: Metadata -> FileType
- fileSizeFromMetadata :: Metadata -> Integer
- accessTimeFromMetadata :: Metadata -> UTCTime
- modificationTimeFromMetadata :: Metadata -> UTCTime
- posix_accessTimeHiRes :: FileStatus -> POSIXTime
- posix_modificationTimeHiRes :: FileStatus -> POSIXTime
- type Mode = FileMode
- modeFromMetadata :: Metadata -> Mode
- allWriteMode :: FileMode
- hasWriteMode :: Mode -> Bool
- setWriteMode :: Bool -> Mode -> Mode
- setFileMode :: FilePath -> Mode -> IO ()
- setFilePermissions :: FilePath -> Mode -> IO ()
- getAccessPermissions :: FilePath -> IO Permissions
- setAccessPermissions :: FilePath -> Permissions -> IO ()
- copyOwnerFromStatus :: FileStatus -> FilePath -> IO ()
- copyGroupFromStatus :: FileStatus -> FilePath -> IO ()
- tryCopyOwnerAndGroupFromStatus :: FileStatus -> FilePath -> IO ()
- copyFileWithMetadataInternal :: (Metadata -> FilePath -> IO ()) -> (Metadata -> FilePath -> IO ()) -> FilePath -> FilePath -> IO ()
- setTimes :: FilePath -> (Maybe POSIXTime, Maybe POSIXTime) -> IO ()
- getPath :: IO [FilePath]
- getHomeDirectoryInternal :: IO FilePath
- getXdgDirectoryInternal :: IO FilePath -> XdgDirectory -> IO FilePath
- getXdgDirectoryListInternal :: XdgDirectoryList -> IO [FilePath]
- getAppUserDataDirectoryInternal :: FilePath -> IO FilePath
- getUserDocumentsDirectoryInternal :: IO FilePath
- getTemporaryDirectoryInternal :: IO FilePath
Documentation
A generator with side-effects.
emptyListT :: Applicative m => ListT m a #
maybeToListT :: Applicative m => m (Maybe a) -> ListT m a #
listToListT :: Applicative m => [a] -> ListT m a #
liftJoinListT :: Monad m => m (ListT m a) -> ListT m a #
listTToList :: Monad m => ListT m a -> m [a] #
sequenceWithIOErrors_ :: [IO ()] -> IO () #
ignoreIOExceptions :: IO () -> IO () #
Attempt to perform the given action, silencing any IO exception thrown by it.
ioeAddLocation :: IOError -> String -> IOError #
Constructors
| File | |
| SymbolicLink | POSIX: either file or directory link; Windows: file link |
| Directory | |
| DirectoryLink | Windows only: directory link |
Instances
| Bounded FileType # | |
| Enum FileType # | |
Defined in System.Directory.Internal.Common Methods succ :: FileType -> FileType Source # pred :: FileType -> FileType Source # toEnum :: Int -> FileType Source # fromEnum :: FileType -> Int Source # enumFrom :: FileType -> [FileType] Source # enumFromThen :: FileType -> FileType -> [FileType] Source # enumFromTo :: FileType -> FileType -> [FileType] Source # enumFromThenTo :: FileType -> FileType -> FileType -> [FileType] Source # | |
| Eq FileType # | |
| Ord FileType # | |
Defined in System.Directory.Internal.Common | |
| Read FileType # | |
| Show FileType # | |
fileTypeIsDirectory :: FileType -> Bool #
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 #
Return whether the given FileType is a link.
data Permissions #
Constructors
| Permissions | |
Fields
| |
Instances
| Eq Permissions # | |
Defined in System.Directory.Internal.Common | |
| Ord Permissions # | |
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 # | |
| Read Permissions # | |
Defined in System.Directory.Internal.Common | |
| Show Permissions # | |
Defined in System.Directory.Internal.Common | |
prependCurrentDirectoryWith :: IO FilePath -> FilePath -> IO FilePath #
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)
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.
Copy all data from a file to a handle.
Copy data from one handle to another until end of file.
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 |
| XdgConfig | For configuration files.
Defaults to |
| XdgCache | For non-essential files (e.g. cache).
Defaults to |
Instances
data XdgDirectoryList #
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 |
| XdgConfigDirs | For configuration files.
Defaults to |
Instances
createDirectoryInternal :: FilePath -> IO () #
removePathInternal :: Bool -> FilePath -> IO () #
renamePathInternal :: FilePath -> FilePath -> IO () #
c_PATH_MAX :: Maybe Int #
canonicalizePathWith :: ((FilePath -> IO FilePath) -> FilePath -> IO FilePath) -> FilePath -> IO FilePath #
findExecutablesLazyInternal :: ([FilePath] -> String -> ListT IO FilePath) -> String -> ListT IO FilePath #
getDirectoryContentsInternal :: FilePath -> IO [FilePath] #
setCurrentDirectoryInternal :: FilePath -> IO () #
readSymbolicLink :: FilePath -> IO FilePath #
type Metadata = FileStatus #
getFileMetadata :: FilePath -> IO Metadata #
fileSizeFromMetadata :: Metadata -> Integer #
modeFromMetadata :: Metadata -> Mode #
hasWriteMode :: Mode -> Bool #
setWriteMode :: Bool -> Mode -> Mode #
setFileMode :: FilePath -> Mode -> IO () #
setFilePermissions :: FilePath -> Mode -> IO () #
setAccessPermissions :: FilePath -> Permissions -> IO () #
copyOwnerFromStatus :: FileStatus -> FilePath -> IO () #
copyGroupFromStatus :: FileStatus -> FilePath -> IO () #
tryCopyOwnerAndGroupFromStatus :: FileStatus -> FilePath -> IO () #
copyFileWithMetadataInternal :: (Metadata -> FilePath -> IO ()) -> (Metadata -> FilePath -> IO ()) -> FilePath -> FilePath -> IO () #
getXdgDirectoryInternal :: IO FilePath -> XdgDirectory -> IO FilePath #