Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Show fp => FileOps2 fp fc where
- writeFile2 :: fp -> fc -> ErrIO ()
- readFile2 :: fp -> ErrIO fc
- appendFile2 :: fp -> fc -> ErrIO ()
- writeFileOrCreate2 :: fp -> fc -> ErrIO ()
- readFileOrZero2 :: (FileOps fp, Zeros fc) => fp -> ErrIO fc
- class (Show fd, Show ff) => FileOps2a fd ff where
- getDirContentFiles :: fd -> ErrIO [ff]
- getDirContentNonHiddenFiles :: fd -> ErrIO [ff]
- class Show fp => FileOps fp where
- doesFileExist' :: fp -> ErrIO Bool
- copyOneFile :: fp -> fp -> ErrIO ()
- copyOneFileOver :: fp -> fp -> ErrIO ()
- renameOneFile :: fp -> fp -> ErrIO ()
- deleteFile :: fp -> ErrIO ()
- getDirCont :: fp -> ErrIO [fp]
- getDirContNonHidden :: fp -> ErrIO [fp]
- getMD5 :: fp -> ErrIO (Maybe Text)
- getAppConfigDirectory :: ErrIO fp
- getSymbolicLinkStatus :: fp -> ErrIO FileStatus
- getFileAccess :: fp -> (Bool, Bool, Bool) -> ErrIO Bool
- getFileModificationTime :: fp -> ErrIO EpochTime
- getFileModificationUTCTime :: fp -> ErrIO UTCTime
- openFile2handle :: fp -> IOMode -> ErrIO Handle
- class DirOps fp where
- doesDirExist' :: fp -> ErrIO Bool
- createDir' :: fp -> ErrIO ()
- createDirIfMissing' :: fp -> ErrIO ()
- renameDir' :: fp -> fp -> ErrIO ()
- getDirectoryDirs' :: fp -> ErrIO [fp]
- getDirectoryDirsNonHidden' :: fp -> ErrIO [fp]
- copyDirRecursive :: fp -> fp -> ErrIO ()
- deleteDirRecursive :: fp -> ErrIO ()
- class FileSystemOps fp where
- getPermissions' :: fp -> ErrIO Permissions
- checkSymbolicLink :: fp -> ErrIO Bool
- class FileHandles t where
- write2handle :: Handle -> t -> ErrIO ()
- readLine4handle :: Handle -> ErrIO t
- class Zeros z where
- data IOMode
- data Handle
Documentation
class Show fp => FileOps2 fp fc where Source #
writeFile2 :: fp -> fc -> ErrIO () Source #
readFile2 :: fp -> ErrIO fc Source #
appendFile2 :: fp -> fc -> ErrIO () Source #
writeFileOrCreate2 :: fp -> fc -> ErrIO () Source #
readFileOrZero2 :: (FileOps fp, Zeros fc) => fp -> ErrIO fc Source #
Instances
FileOps2 FilePath ByteString Source # | |
Defined in Uniform.FileStrings writeFile2 :: FilePath -> ByteString -> ErrIO () Source # readFile2 :: FilePath -> ErrIO ByteString Source # appendFile2 :: FilePath -> ByteString -> ErrIO () Source # writeFileOrCreate2 :: FilePath -> ByteString -> ErrIO () Source # | |
FileOps2 FilePath Text Source # | |
Show (Path ar File) => FileOps2 (Path ar File) ByteString Source # | |
Defined in Uniform.FileStrings writeFile2 :: Path ar File -> ByteString -> ErrIO () Source # readFile2 :: Path ar File -> ErrIO ByteString Source # appendFile2 :: Path ar File -> ByteString -> ErrIO () Source # writeFileOrCreate2 :: Path ar File -> ByteString -> ErrIO () Source # readFileOrZero2 :: Path ar File -> ErrIO ByteString Source # | |
Show (Path ar File) => FileOps2 (Path ar File) Text Source # | |
Defined in Uniform.FileStrings | |
Show (Path ar File) => FileOps2 (Path ar File) String Source # | |
Defined in Uniform.FileStrings |
class (Show fd, Show ff) => FileOps2a fd ff where Source #
operations on dir to produce file
getDirContentFiles :: fd -> ErrIO [ff] Source #
getDirContentNonHiddenFiles :: fd -> ErrIO [ff] Source #
class Show fp => FileOps fp where Source #
doesFileExist', copyOneFile, copyOneFileOver, renameOneFile, deleteFile, getDirCont, getDirContNonHidden, getMD5, getAppConfigDirectory, getSymbolicLinkStatus, getFileAccess, getFileModificationTime, openFile2handle
doesFileExist' :: fp -> ErrIO Bool Source #
copyOneFile :: fp -> fp -> ErrIO () Source #
copy a file from old to new source must exist, target must NOT exist
copyOneFileOver :: fp -> fp -> ErrIO () Source #
copy a file from old to new source must exist, target may exist
renameOneFile :: fp -> fp -> ErrIO () Source #
rename a file from old to new
deleteFile :: fp -> ErrIO () Source #
getDirCont :: fp -> ErrIO [fp] Source #
get the directory content - if not existing Nothing, if empty Just [] not returning the special entries . and .. filenames completed with the filename calling check access and readable returns for filepath always an absolute path for Path Rel gives Path Rel results
getDirContNonHidden :: fp -> ErrIO [fp] Source #
get the directory content - if not existing Nothing, if empty Just [] not returning any hidden files alphabetic search to assure that equal directories have equal conten independent of file system internal structure filenames completed with calling fp only for filepath!
getMD5 :: fp -> ErrIO (Maybe Text) Source #
getAppConfigDirectory :: ErrIO fp Source #
find the .config directory path
getSymbolicLinkStatus :: fp -> ErrIO FileStatus Source #
get status if exist (else Nothing) is the status of the link, does not follow the link
getFileAccess :: fp -> (Bool, Bool, Bool) -> ErrIO Bool Source #
check the read, write and execute permission on file dir get content needs execute,
getFileModificationTime :: fp -> ErrIO EpochTime Source #
get the modification time (replaces isFileAbeforeB)
getFileModificationUTCTime :: fp -> ErrIO UTCTime Source #
get the modification time in UTCTIme
Instances
class DirOps fp where Source #
doesDirExist' :: fp -> ErrIO Bool Source #
createDir' :: fp -> ErrIO () Source #
createDirIfMissing' :: fp -> ErrIO () Source #
write in a dir a new file with content getDirPermissions :: fp -> ErrIO D.Permissions
renameDir' :: fp -> fp -> ErrIO () Source #
creates the directory, if missing, recursive for path noop if dir exist
rename directory old to new signals: getFileStatus: does not exist (No such file or directory)
getDirectoryDirs' :: fp -> ErrIO [fp] Source #
getDirectoryDirsNonHidden' :: fp -> ErrIO [fp] Source #
copyDirRecursive :: fp -> fp -> ErrIO () Source #
deleteDirRecursive :: fp -> ErrIO () Source #
copy the directory content recursively, does not follow symlink implemented only for Path n Dir, not FilePath
delete a directory (even non empty), no error if not existing
Instances
class FileSystemOps fp where Source #
getPermissions' :: fp -> ErrIO Permissions Source #
checkSymbolicLink :: fp -> ErrIO Bool Source #
check if the fp points to a symbolic link better use isSimbolicLink (from FileStatus)
Instances
FileSystemOps FilePath Source # | |
Defined in Uniform.FileStrings | |
FileSystemOps (Path ar df) Source # | |
Defined in Uniform.FileStrings getPermissions' :: Path ar df -> ErrIO Permissions Source # |
class FileHandles t where Source #
write2handle :: Handle -> t -> ErrIO () Source #
readLine4handle :: Handle -> ErrIO t Source #
Instances
FileHandles String Source # | |
Defined in Uniform.FileStrings | |
FileHandles ByteString Source # | |
Defined in Uniform.FileStrings write2handle :: Handle -> ByteString -> ErrIO () Source # readLine4handle :: Handle -> ErrIO ByteString Source # | |
FileHandles Text Source # | |
Defined in Uniform.FileStrings | |
FileHandles [Text] Source # | |
Defined in Uniform.FileStrings |
a minimal algebraic type with nothing than an identity useful to identify a specific value in a type
Nothing
Instances
Zeros Bool | |
Zeros Char | |
Zeros Int | |
Zeros () | |
Zeros BSUTF | |
Zeros URL | |
Zeros [a] | |
Zeros (Maybe a) | |
(Zeros a, Zeros b) => Zeros (a, b) | |
Zeros (Path Abs File) Source # | |
Zeros (Path Abs Dir) Source # | |
Zeros (Path Rel File) Source # | |
Zeros (Path Rel Dir) Source # | |
(Zeros a, Zeros b, Zeros c) => Zeros (a, b, c) | |
(Zeros a, Zeros b, Zeros c, Zeros d) => Zeros (a, b, c, d) | |
(Zeros a, Zeros b, Zeros c, Zeros d, Zeros e) => Zeros (a, b, c, d, e) | |
See openFile
Haskell defines operations to read and write characters from and to files,
represented by values of type Handle
. Each value of this type is a
handle: a record used by the Haskell run-time system to manage I/O
with file system objects. A handle has at least the following properties:
- whether it manages input or output or both;
- whether it is open, closed or semi-closed;
- whether the object is seekable;
- whether buffering is disabled, or enabled on a line or block basis;
- a buffer (whose length may be zero).
Most handles will also have a current I/O position indicating where the next
input or output operation will occur. A handle is readable if it
manages only input or both input and output; likewise, it is writable if
it manages only output or both input and output. A handle is open when
first allocated.
Once it is closed it can no longer be used for either input or output,
though an implementation cannot re-use its storage while references
remain to it. Handles are in the Show
and Eq
classes. The string
produced by showing a handle is system dependent; it should include
enough information to identify the handle for debugging. A handle is
equal according to ==
only to itself; no attempt
is made to compare the internal state of different handles for equality.