FilePath

eff FilePathSource

An 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 Source

Returns the last access time of the given file f in milliseconds since the epoch.

def append(data: { str = String }, f: String): Unit Source

Appends str to the given file f.

Creates the file f if it does not exist.

def appendBytes(data: Vector[Int8], f: String): Unit Source

Appends data to the given file f.

Creates the file f if it does not exist.

def appendLines(data: { lines = List[String] }, f: String): Unit Source

Appends lines to the given file f.

Creates the file f if it does not exist.

def creationTime(f: String): Int64 Source

Returns the creation time of the given file f in milliseconds since the epoch.

def exists(f: String): Bool Source

Returns true if the given file f exists.

def isDirectory(f: String): Bool Source

Returns true is the given file f is a directory.

def isExecutable(f: String): Bool Source

Returns true if the given file f is executable.

def isReadable(f: String): Bool Source

Returns true if the given file f is readable.

def isRegularFile(f: String): Bool Source

Returns true if the given file f is a regular file.

def isWritable(f: String): Bool Source

Returns true if the given file f is writable.

def list(f: String): List[String] Source

Returns a list with the names of all files and directories in the given directory d.

def mkDir(d: String): Unit Source

Creates the directory d.

def mkdDirs(d: String): Unit Source

Creates the directory d and all its parent directories.

def modificationTime(f: String): Int64 Source

Returns the last-modified timestamp of the given file f in milliseconds since the epoch.

def read(f: String): String Source

Returns a string of all lines in the given file f.

def readBytes(f: String): Vector[Int8] Source

Returns a vector of all the bytes in the given file f.

def readLines(f: String): List[String] Source

Returns a list of all lines in the given file f.

def size(f: String): Int64 Source

Returns the size of the given file f in bytes.

def truncate(f: String): Unit Source

Truncates the given file f.

def write(data: { str = String }, f: String): Unit Source

Writes 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 Source

Writes 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 Source

Writes lines to the given file f.

Creates f if it does not exist. Overwrites it if it exists.