FileStorage

Abstraction over file system access used by the FUS client.

Implementations may target different platforms (JVM, JS, Native) and storage backends. The API is intentionally minimal and synchronous to keep it portable.

Functions

Link copied to clipboard
open suspend fun close()

Called when FusClient is closed.

Link copied to clipboard
abstract fun delete(path: String)
Link copied to clipboard
abstract fun exists(path: String): Boolean
Link copied to clipboard
abstract fun list(path: String): List<String>
Link copied to clipboard
abstract fun openFileHandle(path: String, mode: FileStorageMode): FileHandle

Opens a file handle at the given path with a platform-specific mode (e.g. "r", "rw"). The returned FileHandle must be closed by the caller when no longer needed.

Link copied to clipboard
abstract fun read(path: String): ByteArray?

Reads entire file contents from path.

Link copied to clipboard
abstract fun write(path: String, content: ByteArray)

Writes content to the file at path, creating or overwriting it.