From 369bf440c4ab2edb213e1c7a56f70721225afcab Mon Sep 17 00:00:00 2001
From: travis-ci
If you interact with low-level libraries, you must not pattern
match on the `File a` type. Instead, you should only use the saved
path
and make no assumptions about the file the path might or
- might not point to.
The String in the path field is always a full path. The free type variable is used in the File/Dir constructor and can hold Handles, Strings representing a file's contents or anything else you can think of.
Instances
Low-level file information.
Constructors
FileInfo | |
Fields
|
Low-level file information.
Constructors
FileInfo | |
Fields
|
pattern FileLike :: File FileInfo -> File FileInfo Source #
Matches on any non-directory kind of files, excluding symlinks.
pattern DirList :: [File FileInfo] -> [File FileInfo] Source #
Matches a list of directories or symlinks pointing to directories.
pattern FileLikeList :: [File FileInfo] -> [File FileInfo] Source #
Matches a list of any non-directory kind of files or symlinks pointing to such.
pattern FileLikeSym :: File FileInfo -> File FileInfo Source #
Matches on symlinks pointing to file-like files only.
pattern DirOrSym :: File FileInfo -> File FileInfo Source #
Matches on directories or symlinks pointing to directories. @@ -30,5 +30,4 @@ window.onload = function () {pageLoad();setSynopsis("mini_HSFM-FileSystem-FileTy variables via the given function.
readDirectoryContents Source #
Get the contents of a given directory and return them as a list
of AnchoredFile
.
getContents :: (Path Abs -> IO a) -> File FileInfo -> IO [File a] Source #
A variant of readDirectoryContents
where the second argument
is a File
. If a non-directory is passed returns an empty list.
goUp :: File FileInfo -> IO (File FileInfo) Source #
Go up one directory in the filesystem hierarchy.
getFileInfo :: Path Abs -> IO FileInfo Source #
Gets all file information.
isBrokenSymlink :: File FileInfo -> Bool Source #
Checks if a symlink is broken by examining the constructor of the - symlink destination.
When called on a non-symlink, returns False.
epochToString :: EpochTime -> String Source #
packPermissions :: File FileInfo -> String Source #
Pack the permissions into a string, similar to what "ls -l" does.
packFileType :: File a -> String Source #
packLinkDestination :: File a -> Maybe ByteString Source #
fromFreeVar :: Default d => (a -> d) -> File a -> d Source #
Apply a function on the free variable. If there is no free variable
- for the given constructor the value from the Default
class is used.
getFPasStr :: File a -> String Source #
getFreeVar :: File a -> Maybe a Source #
Gets the free variable. Returns Nothing if the constructor is of Failed
.