diff --git a/HSFM-FileSystem-FileType.html b/HSFM-FileSystem-FileType.html index 3e3598e..746bc8d 100644 --- a/HSFM-FileSystem-FileType.html +++ b/HSFM-FileSystem-FileType.html @@ -10,25 +10,25 @@ window.onload = function () {pageLoad();setSynopsis("mini_HSFM-FileSystem-FileTy happening on filesystem level.
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. We catch any IO errors in the Failed constructor.
Eq a => Eq (File a) Source # | |||||||||
Ord (File FileInfo) Source # | First compare constructors: Failed < Dir < File... + think of. We catch any IO errors in the Failed constructor. Low-level file information.
Low-level file information.
pattern FileLike :: File FileInfo -> File FileInfo Source # Matches on any non-directory kind of files, excluding symlinks. pattern DirList :: forall t. (Foldable t, Functor t) => t (File FileInfo) -> t (File FileInfo) Source # Matches a list of directories or symlinks pointing to directories. pattern FileLikeList :: forall t. (Foldable t, Functor t) => t (File FileInfo) -> t (File FileInfo) Source # Matches a list of any non-directory kind of files or symlinks - pointing to such. | ||||||||
pattern FileLike :: File FileInfo -> File FileInfo Source #
Matches on any non-directory kind of files, excluding symlinks.
pattern DirList :: forall t. (Foldable t, Functor t) => t (File FileInfo) -> t (File FileInfo) Source #
Matches a list of directories or symlinks pointing to directories.
pattern FileLikeList :: forall t. (Foldable t, Functor t) => t (File FileInfo) -> t (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. If the symlink is pointing to a symlink pointing to a directory, then it will return True, but also return the first element in the symlink- chain, not the last.
pattern DirSym :: File FileInfo -> File FileInfo Source #
Matches on symlinks pointing to directories only.
pattern FileLikeOrSym :: File FileInfo -> File FileInfo Source #
Matches on any non-directory kind of files or symlinks pointing to such. If the symlink is pointing to a symlink pointing to such a file, then it will return True, but also return the first element in the symlink- - chain, not the last.
readFile :: (Path Abs -> IO a) -> Path Abs -> IO (File a) Source #
Reads a file or directory Path into an AnchoredFile
, filling the free
- variables via the given function.
readDirectoryContents Source #
:: (Path Abs -> IO a) | fills free a variable |
-> Path Abs | path to read |
-> IO [File a] |
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.
successful :: [File a] -> Bool Source #
True if there are no Failed constructors in the tree.
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.
packModTime :: File FileInfo -> String Source #
Pack the modification time into a string.
packAccessTime :: File FileInfo -> String Source #
Pack the modification time into a string.
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
.