/**
 * RPC interface for the filesystem server. It provides read/write access to files in an unified
 * single namespace. Filesystems can be mounted in place of directories.
 */
interface Filesystem {
    /**
     * Attempts to open the file at the given path.
     *
     * @return Status code, and a handle (which will always have the high byte clear)
     */
    OpenFile(path: String, mode: UInt32) => (status: Int32, handle: UInt64, fileSize: UInt64)

    /**
     * Reads from the given file and returns the data directly. This should only be used for
     * small read requests as the data is copied via the message rather than through a shared
     * memory region.
     */
    SlowRead(handle: UInt64, offset: UInt64, numBytes: UInt16) => (status: Int32, data: Blob)

    /**
     * Closes a previously opened file.
     */
    CloseFile(handle: UInt64) => (status: Int32)
}
