(->filesystem files path-pool id root-path)
Positional factory function for class phlegyas.vfs.filesystem.
Positional factory function for class phlegyas.vfs.filesystem.
(->qid qid-type qid-vers qid-path)
Positional factory function for class phlegyas.vfs.qid.
Positional factory function for class phlegyas.vfs.qid.
(->stat dev
qid-type
qid-vers
qid-path
mode
atime
mtime
length
name
size
ssize
uid
gid
muid
children
contents
permissions
parent)
Positional factory function for class phlegyas.vfs.stat.
Positional factory function for class phlegyas.vfs.stat.
(access-time fh)
Get the last access time of a file.
Get the last access time of a file.
(add-fid state fid tag)
Add a new fid to the fid map, along with the tag id of the request responsible.
Add a new fid to the fid map, along with the tag id of the request responsible.
(add-fs state fs)
Add the given filesystem to the connection. Used during attach.
Add the given filesystem to the connection. Used during attach.
(add-mapping state fid fs path)
Add a new fid to the connection. Takes in the current state, new fid, filesystem id, and path of the fid.
Add a new fid to the connection. Takes in the current state, new fid, filesystem id, and path of the fid.
(add-role state fsid uid gid)
Add the user/group that issued the attach to the role map.
Add the user/group that issued the attach to the role map.
(attrs fh)
Get the PosixFileAttributes of a file.
Get the PosixFileAttributes of a file.
(create-filesystem)
Create a filesystem record.
Create a filesystem record.
(directory-reader fs paths max-size)
Takes a filesystem, a list of paths, and the requested byte count. Recursively fetches the stat entries for the given paths, packing them into the correct byte format. Returns when either the paths are exhausted, or we reached the byte count. Returns a vector of 2 values, the left is the data, the right is the paths that we could not walk due to size limitations. This can be then consulted on subsequent directory reads.
Takes a filesystem, a list of paths, and the requested byte count. Recursively fetches the stat entries for the given paths, packing them into the correct byte format. Returns when either the paths are exhausted, or we reached the byte count. Returns a vector of 2 values, the left is the data, the right is the paths that we could not walk due to size limitations. This can be then consulted on subsequent directory reads.
(fetch-data connection frame stat)
Helper function for calling read-fn
on a stat.
Helper function for calling `read-fn` on a stat.
(fid->fsname state fid)
Get the filesystem id that a fid belongs to.
Get the filesystem id that a fid belongs to.
(fid->mapping conn fid)
Get the mapping corresponding to an allocated fid.
Get the mapping corresponding to an allocated fid.
(fid->role fid conn)
Given a fid and a connection, return the role associated with it.
Given a fid and a connection, return the role associated with it.
(fid->stat state fid)
Get the stat corresponding to the fid in the current state of the connection.
Get the stat corresponding to the fid in the current state of the connection.
(file->stat file
path
&
{:keys [read-fn parent length]
:or {read-fn (var identity) parent nil length nil}})
Given a filesystem path, and a 9P path number, create a stat for it. Optional keyword
arguments read-fn
is a function that is called upon reads, parent
is the path of
the directory the file belongs to, and length
can be used to manually set file size.
Given a filesystem path, and a 9P path number, create a stat for it. Optional keyword arguments `read-fn` is a function that is called upon reads, `parent` is the path of the directory the file belongs to, and `length` can be used to manually set file size.
(insert-file fs parent stat)
Given a filesystem, and a path, inserts the stat to the filesystem and updates the provided parent path list of children to include the newly inserted stat.
Given a filesystem, and a path, inserts the stat to the filesystem and updates the provided parent path list of children to include the newly inserted stat.
(map->filesystem m__7910__auto__)
Factory function for class phlegyas.vfs.filesystem, taking a map of keywords to field values.
Factory function for class phlegyas.vfs.filesystem, taking a map of keywords to field values.
(map->qid m__7910__auto__)
Factory function for class phlegyas.vfs.qid, taking a map of keywords to field values.
Factory function for class phlegyas.vfs.qid, taking a map of keywords to field values.
(map->stat m__7910__auto__)
Factory function for class phlegyas.vfs.stat, taking a map of keywords to field values.
Factory function for class phlegyas.vfs.stat, taking a map of keywords to field values.
(modification-time fh)
Get the last modified time of a file.
Get the last modified time of a file.
(next-available-path fs)
Get the next value from the atomic counter.
Get the next value from the atomic counter.
(octal-mode fh)
Get the octal mode permissions of a file.
Get the octal mode permissions of a file.
(path->qid fs path)
Given a filesystem and a path, return the qid for the path.
Given a filesystem and a path, return the qid for the path.
(path->stat fs path)
Given a filesystem and a path, return the stat of the file.
Given a filesystem and a path, return the stat of the file.
(permission-check stat rolemap operation)
Given a stat, a role, and an operation we want to perform, see if we are allowed to perform it.
Given a stat, a role, and an operation we want to perform, see if we are allowed to perform it.
(permission-set fh)
Get the set of permissions for a file.
Get the set of permissions for a file.
(qid-directory? qid)
Is the provided qid a representation of a directory?
Is the provided qid a representation of a directory?
(qid-file? qid)
Is the provided qid a representation of a file?
Is the provided qid a representation of a file?
(read-dir fs stat)
Given a filesystem and a stat, get all children stats of provided stat.
Given a filesystem and a stat, get all children stats of provided stat.
(role-resolve stat role)
Given a stat and a role, find what role we have on the stat.
Given a stat and a role, find what role we have on the stat.
(stat->role stat user)
Given a stat, and a user, find what role we have on it.
Given a stat, and a user, find what role we have on it.
(stat-size fname uid gid muid)
Calculate the size of a stat reply.
Calculate the size of a stat reply.
(symbolic-link? fh)
Is the file a symbolic link?
Is the file a symbolic link?
(synthetic-file filename
&
{:keys [owner group mode read-fn write-fn metadata append]
:or {owner "root" group "root" mode 256 append false}})
Create a synthetic file stat.
Create a synthetic file stat.
(update-children fs path keyname child)
Takes a filesystem, a path, a lookup key (filename, hashed), and the child path. Updates the stat corresponding to path on fs by adding the child.
Takes a filesystem, a path, a lookup key (filename, hashed), and the child path. Updates the stat corresponding to path on fs by adding the child.
(update-mapping state fid data)
Update the mapping for fid with the provided data.
Update the mapping for fid with the provided data.
(update-stat state fid data)
Update the stat associated with fid by adding data to it.
Update the stat associated with fid by adding data to it.
(walk-path fs path wnames)
Given a filesystem, a path, and a vector wnames
, step through the vector
attempting to resolve the path of each. i.e. if we are in the root, and want
to go to /a/b/c, wnames would be ["a", "b", "c"]. If we do not find a
match for a wname, we return a list of all paths that we did find. In this
case, a fid is not changed. Walks are only successful if the entire path can
be walked.
Given a filesystem, a path, and a vector `wnames`, step through the vector attempting to resolve the path of each. i.e. if we are in the root, and want to go to /a/b/c, wnames would be ["a", "b", "c"]. If we do not find a match for a wname, we return a list of all paths that we _did_ find. In this case, a fid is not changed. Walks are only successful if the entire path can be walked.
(wname->path fs path wname)
Given a filesystem, a path, and a wname (file name), look through the children of the stat for the given path and return the path associated with that name. We hash the name of the file here, and keywordize it, to prevent issues with keywordizing arbitrary strings.
Given a filesystem, a path, and a wname (file name), look through the children of the stat for the given path and return the path associated with that name. We hash the name of the file here, and keywordize it, to prevent issues with keywordizing arbitrary strings.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close