FileReadWithResult
eff FileReadWithResult
SourceAn effect used to read from the file system.
Operations
def accessTime(f: String): Result[IoError, Int64]
SourceReturns the last access time of the given file f
in milliseconds since the epoch.
def creationTime(f: String): Result[IoError, Int64]
SourceReturns the creation time of the given file f
in milliseconds since the epoch.
def exists(f: String): Result[IoError, Bool]
SourceReturns true
if the given file f
exists.
def isDirectory(f: String): Result[IoError, Bool]
SourceReturns true
is the given file f
is a directory.
def isExecutable(f: String): Result[IoError, Bool]
SourceReturns true
if the given file f
is executable.
def isReadable(f: String): Result[IoError, Bool]
SourceReturns true
if the given file f
is readable.
def isRegularFile(f: String): Result[IoError, Bool]
SourceReturns true
if the given file f
is a regular file.
def isSymbolicLink(f: String): Result[IoError, Bool]
SourceReturns true
if the given file f
is a symbolic link.
def isWritable(f: String): Result[IoError, Bool]
SourceReturns true
if the given file f
is writable.
def list(f: String): Result[IoError, List[String]]
SourceReturns a list with the names of all files and directories in the given directory d
.
def modificationTime(f: String): Result[IoError, Int64]
SourceReturns the last-modified timestamp of the given file f
in milliseconds since the epoch.
def read(f: String): Result[IoError, String]
SourceReturns a string of all lines in the given file f
.
def readBytes(f: String): Result[IoError, Vector[Int8]]
SourceReturns a vector of all the bytes in the given file f
.
def readLines(f: String): Result[IoError, List[String]]
SourceReturns a list of all lines in the given file f
.
def size(f: String): Result[IoError, Int64]
SourceReturns the size of the given file f
in bytes.
Definitions
def handle(f: a -> b \ ef): a -> b \ (ef - FileReadWithResult) + IO
SourceHandles the FileReadWithResult
effect of the given function f
.
In other words, re-interprets the FileReadWithResult
effect using the IO
effect.