FilePath
eff FilePath
SourceAn effect used to interact with the file system.
All operations on this effect are infalliable. If an operation fails the handler must deal with it.
Operations
def accessTime(f: String): Int64
SourceReturns the last access time of the given file f
in milliseconds since the epoch.
def append(data: { str = String }, f: String): Unit
SourceAppends str
to the given file f
.
Creates the file f
if it does not exist.
def appendBytes(data: Vector[Int8], f: String): Unit
SourceAppends data
to the given file f
.
Creates the file f
if it does not exist.
def appendLines(data: { lines = List[String] }, f: String): Unit
SourceAppends lines
to the given file f
.
Creates the file f
if it does not exist.
def creationTime(f: String): Int64
SourceReturns the creation time of the given file f
in milliseconds since the epoch.
def exists(f: String): Bool
SourceReturns true
if the given file f
exists.
def isDirectory(f: String): Bool
SourceReturns true
is the given file f
is a directory.
def isExecutable(f: String): Bool
SourceReturns true
if the given file f
is executable.
def isReadable(f: String): Bool
SourceReturns true
if the given file f
is readable.
def isRegularFile(f: String): Bool
SourceReturns true
if the given file f
is a regular file.
def isSymbolicLink(f: String): Bool
SourceReturns true
if the given file f
is a symbolic link.
def isWritable(f: String): Bool
SourceReturns true
if the given file f
is writable.
def list(f: String): List[String]
SourceReturns a list with the names of all files and directories in the given directory d
.
def mkDir(d: String): Unit
SourceCreates the directory d
.
def mkdDirs(d: String): Unit
SourceCreates the directory d
and all its parent directories.
def modificationTime(f: String): Int64
SourceReturns the last-modified timestamp of the given file f
in milliseconds since the epoch.
def read(f: String): String
SourceReturns a string of all lines in the given file f
.
def readBytes(f: String): Vector[Int8]
SourceReturns a vector of all the bytes in the given file f
.
def readLines(f: String): List[String]
SourceReturns a list of all lines in the given file f
.
def size(f: String): Int64
SourceReturns the size of the given file f
in bytes.
def truncate(f: String): Unit
SourceTruncates the given file f
.
def write(data: { str = String }, f: String): Unit
SourceWrites str
to the given file f
.
Creates file f
if it does not exist. Overwrites it if it exists.
def writeBytes(data: Vector[Int8], f: String): Unit
SourceWrites data
to the given file f
.
Creates file f
if it does not exist. Overwrites it if it exists.
def writeLines(data: { lines = List[String] }, f: String): Unit
SourceWrites lines
to the given file f
.
Creates f
if it does not exist. Overwrites it if it exists.