uniform-fileio-0.1.5.1: Uniform file handling operations
Safe HaskellSafe-Inferred
LanguageHaskell2010

Uniform.FileIOalgebra

Synopsis

Documentation

class Show fp => FileOps2 fp fc where Source #

Minimal complete definition

writeFile2, readFile2, appendFile2, writeFileOrCreate2

Methods

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

Instances details
FileOps2 FilePath ByteString Source # 
Instance details

Defined in Uniform.FileStrings

FileOps2 FilePath Text Source # 
Instance details

Defined in Uniform.FileStrings

Show (Path ar File) => FileOps2 (Path ar File) ByteString Source # 
Instance details

Defined in Uniform.FileStrings

Show (Path ar File) => FileOps2 (Path ar File) Text Source # 
Instance details

Defined in Uniform.FileStrings

Show (Path ar File) => FileOps2 (Path ar File) String Source # 
Instance details

Defined in Uniform.FileStrings

class Show fp => FileOps fp where Source #

Methods

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

openFile2handle :: fp -> IOMode -> ErrIO Handle Source #

Instances

Instances details
FileOps FilePath Source # 
Instance details

Defined in Uniform.FileStrings

Show (Path ar File) => FileOps (Path ar File) Source # 
Instance details

Defined in Uniform.FileStrings

class DirOps fp where Source #

Methods

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

Instances details
DirOps FilePath Source # 
Instance details

Defined in Uniform.FileStrings

DirOps (Path Abs Dir) Source # 
Instance details

Defined in Uniform.FileStrings

DirOps (Path Rel Dir) Source # 
Instance details

Defined in Uniform.FileStrings

class FileSystemOps fp where Source #

Methods

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

Instances details
FileSystemOps FilePath Source # 
Instance details

Defined in Uniform.FileStrings

FileSystemOps (Path ar df) Source # 
Instance details

Defined in Uniform.FileStrings

class Zeros z where #

a minimal algebraic type with nothing than an identity useful to identify a specific value in a type

Minimal complete definition

Nothing

Methods

zero :: z #

isZero :: z -> Bool #

notZero :: z -> Bool #

Instances

Instances details
Zeros BSUTF 
Instance details

Defined in Uniform.Strings.Conversion

Methods

zero :: BSUTF #

isZero :: BSUTF -> Bool #

notZero :: BSUTF -> Bool #

Zeros URL 
Instance details

Defined in Uniform.Strings.Conversion

Methods

zero :: URL #

isZero :: URL -> Bool #

notZero :: URL -> Bool #

Zeros () 
Instance details

Defined in Uniform.Zero

Methods

zero :: () #

isZero :: () -> Bool #

notZero :: () -> Bool #

Zeros Bool 
Instance details

Defined in Uniform.Zero

Methods

zero :: Bool #

isZero :: Bool -> Bool #

notZero :: Bool -> Bool #

Zeros Char 
Instance details

Defined in Uniform.Zero

Methods

zero :: Char #

isZero :: Char -> Bool #

notZero :: Char -> Bool #

Zeros Int 
Instance details

Defined in Uniform.Zero

Methods

zero :: Int #

isZero :: Int -> Bool #

notZero :: Int -> Bool #

Zeros (Maybe a) 
Instance details

Defined in Uniform.Zero

Methods

zero :: Maybe a #

isZero :: Maybe a -> Bool #

notZero :: Maybe a -> Bool #

Zeros [a] 
Instance details

Defined in Uniform.Zero

Methods

zero :: [a] #

isZero :: [a] -> Bool #

notZero :: [a] -> Bool #

Zeros (Path Abs Dir) Source # 
Instance details

Defined in Uniform.Filenames

Zeros (Path Abs File) Source # 
Instance details

Defined in Uniform.Filenames

Zeros (Path Rel Dir) Source # 
Instance details

Defined in Uniform.Filenames

Zeros (Path Rel File) Source # 
Instance details

Defined in Uniform.Filenames

(Zeros a, Zeros b) => Zeros (a, b) 
Instance details

Defined in Uniform.Zero

Methods

zero :: (a, b) #

isZero :: (a, b) -> Bool #

notZero :: (a, b) -> Bool #

(Zeros a, Zeros b, Zeros c) => Zeros (a, b, c) 
Instance details

Defined in Uniform.Zero

Methods

zero :: (a, b, c) #

isZero :: (a, b, c) -> Bool #

notZero :: (a, b, c) -> Bool #

(Zeros a, Zeros b, Zeros c, Zeros d) => Zeros (a, b, c, d) 
Instance details

Defined in Uniform.Zero

Methods

zero :: (a, b, c, d) #

isZero :: (a, b, c, d) -> Bool #

notZero :: (a, b, c, d) -> Bool #

(Zeros a, Zeros b, Zeros c, Zeros d, Zeros e) => Zeros (a, b, c, d, e) 
Instance details

Defined in Uniform.Zero

Methods

zero :: (a, b, c, d, e) #

isZero :: (a, b, c, d, e) -> Bool #

notZero :: (a, b, c, d, e) -> Bool #

data IOMode #

Instances

Instances details
Enum IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Ix IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Read IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Show IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Eq IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Methods

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

(/=) :: IOMode -> IOMode -> Bool #

Ord IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

data Handle #

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.

Instances

Instances details
Show Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Eq Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Methods

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

(/=) :: Handle -> Handle -> Bool #