chickadee » fuse » make-filesystem

make-filesystem #!key <operation> ...procedure

Create a FUSE filesystem.

The keyword arguments to make-filesystem specify the resulting filesystem's callback procedures. Each <operation> should be one the following:

access:
(procedure path mode) -> value
chmod:
(procedure path mode) -> value
chown:
(procedure uid gid) -> value
create:
(procedure path mode) -> (or handle false)
destroy:
(procedure) -> void
flush:
(procedure path) -> value
fsync:
(procedure path) -> value
getattr:
(procedure path) -> (or (vector mode nlink uid gid size atime ctime mtime) false)
init:
(procedure) -> void
ioctl:
(procedure path int pointer) -> value
link:
(procedure path path) -> value
mkdir:
(procedure path mode) -> value
mknod:
(procedure path mode) -> value
open:
(procedure path mode) -> (or handle false)
readdir:
(procedure path) -> (or (list path ...) value)
readlink:
(procedure path) -> (or path false)
read:
(procedure handle size offset) -> (or size string value)
release:
(procedure handle) -> value
rename:
(procedure path path) -> value
rmdir:
(procedure path) -> value
statfs:
(procedure path) -> (or (vector bsize blocks bfree bavail files ffree namemax) false)
symlink:
(procedure path path) -> value
truncate:
(procedure path) -> value
unlink:
(procedure path) -> value
utimens:
(procedure path atime mtime) -> value
write:
(procedure handle string offset) -> (or size string value)

offset, size, mode, nlink, uid, gid, size, atime, ctime and mtime are numeric values with the obvious meanings. A path is a pathname string. bsize, blocks, bfree, bavail, files, ffree and namemax are positive numeric values corresponding to the statvfs(2) struct members of the same names.

A value may be any Scheme object and indicates whether the filesystem operation was successful. When false, the filesystem will indicate a nonexistent file (ENOENT); any other value indicates success. Callbacks should signal other types of failures by raising an appropriate errno(3) value. For example, to signal insufficient permissions, an access: operation should (raise errno/perm).

A handle may be any Scheme object and represents a file handle. When returned as the result of an open: or create:callback, this value is provided to that file's subsequent read:, write: and release: operations. release: is guaranteed to be called once for every successful open: or create:, while read: and write: should be prepared to be called multiple times with diverse offset values.