flix

0.78.0

InMemoryFs

Type of fully in-memory file systems, and its functions.

Enums

EntryType of in-memory file contents, either text or bytes.

Definitions

def accessTime(path: String, o: InMemoryFs[r]): Result[IoError, Int64] \ r§ Source

Returns the last access time of path in o in milliseconds since the epoch.

def append(path: String, data: String, o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Appends the string data to the file path in o, creating it if it does not exist.

def appendBytes(path: String, data: Vector[Int8], o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Appends the bytes data to the file path in o, creating it if it does not exist.

def appendLines(path: String, lines: List[String], o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Appends the given lines to the file path in o, creating it if it does not exist.

def copy(src: String, dst: String, opts: Set[CopyOption], o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Copies the file src to dst in o using the given copy options opts.

def creationTime(path: String, o: InMemoryFs[r]): Result[IoError, Int64] \ r§ Source

Returns the creation time of path in o in milliseconds since the epoch.

def delete(path: String, o: InMemoryFs[r]): Result[IoError, Unit] \ r§ Source

Deletes the file or directory path from o.

def exists(path: String, o: InMemoryFs[r]): Result[IoError, Bool] \ r§ Source

Returns true if path exists as a file or directory in o.

def fresh(rc: Region[r]): InMemoryFs[r] \ r§ Source

Creates a fresh, empty in-memory filesystem in region rc.

def glob(base: String, pattern: String, o: InMemoryFs[r]): Result[IoError, List[String]] \ r§ Source

Returns the paths in o under base that match the glob pattern.

def isDirectory(path: String, o: InMemoryFs[r]): Result[IoError, Bool] \ r§ Source

Returns true if path is a directory in o.

def isExecutable(path: String, o: InMemoryFs[r]): Result[IoError, Bool] \ r§ Source

Returns false, since no entry in the in-memory file system is executable.

def isReadable(path: String, o: InMemoryFs[r]): Result[IoError, Bool] \ r§ Source

Returns true if path exists in o, since every entry is readable.

def isRegularFile(path: String, o: InMemoryFs[r]): Result[IoError, Bool] \ r§ Source

Returns true if path is a file in o.

def isWritable(path: String, o: InMemoryFs[r]): Result[IoError, Bool] \ r§ Source

Returns true if path exists in o, since every entry is writable.

def list(dir: String, o: InMemoryFs[r]): Result[IoError, List[String]] \ r§ Source

Returns the names of the entries in the directory dir in o.

def mkDir(path: String, o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Creates the directory path in o, failing if it already exists.

def mkDirs(path: String, o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Creates the directory path and any missing parent directories in o.

def mkTempDir(prefix: String, o: InMemoryFs[r]): Result[IoError, String] \ r + Clock§ Source

Creates a new temporary directory in o whose name starts with prefix and returns its path.

def modificationTime(path: String, o: InMemoryFs[r]): Result[IoError, Int64] \ r§ Source

Returns the last modification time of path in o in milliseconds since the epoch.

def move(src: String, dst: String, opts: Set[MoveOption], o: InMemoryFs[r]): Result[IoError, Unit] \ r§ Source

Moves the file src to dst in o using the given move options opts.

def read(path: String, o: InMemoryFs[r]): Result[IoError, String] \ r + Clock§ Source

Returns the contents of the file path in o as a string.

def readBytes(path: String, o: InMemoryFs[r]): Result[IoError, Vector[Int8]] \ r + Clock§ Source

Returns the contents of the file path in o as a vector of bytes.

def readLines(path: String, o: InMemoryFs[r]): Result[IoError, List[String]] \ r + Clock§ Source

Returns the lines of the file path in o.

def size(path: String, o: InMemoryFs[r]): Result[IoError, Size] \ r§ Source

Returns the size of the file path in o.

def truncate(path: String, o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Truncates the existing file path in o to zero length.

def write(path: String, data: String, o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Writes the string data to the file path in o, replacing any existing contents.

def writeBytes(path: String, data: Vector[Int8], o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Writes the bytes data to the file path in o, replacing any existing contents.

def writeLines(path: String, lines: List[String], o: InMemoryFs[r]): Result[IoError, Unit] \ r + Clock§ Source

Writes the given lines to the file path in o, replacing any existing contents.