This is the purgatory Reference Manual, version 0.1.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:21:38 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
purgatory
A simple implementation of the 9p filesystem protocol.
cage
cage
LLGPL
0.1.2
alexandria
(system).
cl-ppcre
(system).
usocket
(system).
babel
(system).
uiop
(system).
package.lisp
(file).
text-utils.lisp
(file).
misc-utils.lisp
(file).
filesystem-utils.lisp
(file).
conditions.lisp
(file).
message-types.lisp
(file).
client.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
purgatory/purgatory.asd
purgatory/package.lisp
purgatory/text-utils.lisp
purgatory/misc-utils.lisp
purgatory/filesystem-utils.lisp
purgatory/conditions.lisp
purgatory/message-types.lisp
purgatory/client.lisp
purgatory/text-utils.lisp
package.lisp
(file).
purgatory
(system).
strcat
(function).
strcat*
(function).
purgatory/misc-utils.lisp
text-utils.lisp
(file).
purgatory
(system).
safe-all-but-last-elt
(function).
defcond
(macro).
delete@
(generic function).
gen-delete@
(macro).
idx
(reader method).
out-of-bounds
(condition).
safe-delete@
(generic function).
seq
(reader method).
text
(reader method).
text-error
(condition).
purgatory/filesystem-utils.lisp
misc-utils.lisp
(file).
purgatory
(system).
*directory-sep-regexp*
(special variable).
backreference-dir-p
(function).
cat-parent-dir
(function).
getenv
(function).
loopback-reference-dir-p
(function).
parent-dir-path
(function).
path-last-element
(function).
path-referencing-dir-p
(function).
split-path-elements
(function).
*directory-sep*
(special variable).
+file-path-regex+
(constant).
purgatory/conditions.lisp
filesystem-utils.lisp
(file).
purgatory
(system).
9p-error
(condition).
9p-authorization-error
(condition).
9p-initialization-error
(condition).
connection-data
(reader method).
error-value
(reader method).
message-type
(reader method).
rtag
(reader method).
tag
(reader method).
tag
(reader method).
purgatory/message-types.lisp
conditions.lisp
(file).
purgatory
(system).
*rattach*
(special variable).
*rauth*
(special variable).
*rclunk*
(special variable).
*rcreate*
(special variable).
*rerror*
(special variable).
*rflush*
(special variable).
*ropen*
(special variable).
*rread*
(special variable).
*rremove*
(special variable).
*rstat*
(special variable).
*rversion*
(special variable).
*rwalk*
(special variable).
*rwrite*
(special variable).
*rwstat*
(special variable).
*tattach*
(special variable).
*tauth*
(special variable).
*tclunk*
(special variable).
*tcreate*
(special variable).
*terror*
(special variable).
*tflush*
(special variable).
*topen*
(special variable).
*tread*
(special variable).
*tremove*
(special variable).
*tstat*
(special variable).
*tversion*
(special variable).
*twalk*
(special variable).
*twrite*
(special variable).
*twstat*
(special variable).
purgatory/client.lisp
message-types.lisp
(file).
purgatory
(system).
*buffer-size*
(special variable).
*fid*
(special variable).
*messages-sent*
(special variable).
*tag*
(special variable).
+byte-type+
(constant).
+create-dir+
(constant).
+create-for-exec+
(constant).
+create-for-read+
(constant).
+create-for-read-write+
(constant).
+create-for-write+
(constant).
+nofid+
(constant).
+nwname-clone+
(constant).
+open-remove-on-clunk+
(constant).
+open-truncate+
(constant).
+standard-socket-port+
(constant).
+version+
(constant).
9p-attach
(generic function).
9p-auth
(function).
9p-clunk
(function).
9p-create
(function).
9p-open
(function).
9p-read
(function).
9p-remove
(function).
9p-stat
(function).
9p-walk
(function).
9p-write
(generic function).
change-access-time
(function).
change-mode
(function).
change-modify-time
(function).
change-permissions
(function).
change-time-values
(function).
clone-fid
(function).
close-client
(function).
collect-directory-children
(function).
collect-tree
(function).
copy-file
(function).
create-directory
(function).
create-path
(function).
decode
(generic function).
decode-read-reply
(function).
decode-rstat
(function).
decode-string
(method).
dummy-callback
(function).
dump-callback
(function).
encode
(generic function).
encode-string
(function).
initialize-session
(function).
make-permissions
(function).
make-stat
(function).
mount
(function).
move-file
(function).
open-directory
(function).
open-path
(function).
path-exists-p
(function).
path-info
(function).
permissions-group
(reader).
(setf permissions-group)
(writer).
permissions-group-string
(reader).
(setf permissions-group-string)
(writer).
permissions-original-value
(reader).
(setf permissions-original-value)
(writer).
permissions-others
(reader).
(setf permissions-others)
(writer).
permissions-others-string
(reader).
(setf permissions-others-string)
(writer).
permissions-user
(reader).
(setf permissions-user)
(writer).
permissions-user-string
(reader).
(setf permissions-user-string)
(writer).
read-all-pending-messages
(function).
read-all-pending-messages-ignoring-errors
(function).
read-directory
(function).
read-entire-file-apply-function
(function).
read-message
(function).
remove-path
(function).
slurp-file
(function).
sort-dir-stats
(function).
stat-atime
(reader).
(setf stat-atime)
(writer).
stat-entry-size
(reader).
(setf stat-entry-size)
(writer).
stat-entry-type
(reader).
(setf stat-entry-type)
(writer).
stat-group-id
(reader).
(setf stat-group-id)
(writer).
stat-kdev
(reader).
(setf stat-kdev)
(writer).
stat-ktype
(reader).
(setf stat-ktype)
(writer).
stat-last-modified-from-id
(reader).
(setf stat-last-modified-from-id)
(writer).
stat-mode
(reader).
(setf stat-mode)
(writer).
stat-mtime
(reader).
(setf stat-mtime)
(writer).
stat-name
(reader).
(setf stat-name)
(writer).
stat-path
(reader).
(setf stat-path)
(writer).
stat-size
(reader).
(setf stat-size)
(writer).
stat-user-id
(reader).
(setf stat-user-id)
(writer).
stat-version
(reader).
(setf stat-version)
(writer).
truncate-file
(function).
with-new-fid
(macro).
with-new-tag
(macro).
%9p-walk-self
(function).
*unix-epoch-difference*
(special variable).
+9p-read-header-fixed-size+
(constant).
+9p-write-header-fixed-size+
(constant).
+file-types+
(constant).
+message-length-size+
(constant).
+message-string-length-size+
(constant).
+message-tag-size+
(constant).
+message-type-size+
(constant).
+stat-type-append+
(constant).
+stat-type-auth+
(constant).
+stat-type-dir+
(constant).
+stat-type-excl+
(constant).
+stat-type-exec+
(constant).
+stat-type-file+
(constant).
+stat-type-mount+
(constant).
+stat-type-read+
(constant).
+stat-type-symlink+
(constant).
+stat-type-tmp+
(constant).
+stat-type-write+
(constant).
+wstat-ignore-1+
(constant).
+wstat-ignore-2+
(constant).
+wstat-ignore-4+
(constant).
+wstat-ignore-8+
(constant).
9p-wstat
(generic function).
add-size
(function).
append-tag-callback
(function).
big-endian->little-endian
(function).
bytes->int
(function).
cat-reply-vector
(function).
change-time
(function).
close-ssl-socket
(function).
compose-message
(function).
copy-permissions
(function).
copy-stat
(function).
decode-permissions
(function).
decode-quid
(function).
displace-response
(function).
encode-permissions
(function).
encoded-string-offset
(function).
error-response-p
(function).
exhausted-stream-for-read-p
(function).
file-type-number->symbol
(function).
fire-response
(function).
gen-intn->bytes
(macro).
ignore-response
(function).
int16->bytes
(function).
int32->bytes
(function).
int416->bytes
(function).
int512->bytes
(function).
int64->bytes
(function).
int8->bytes
(function).
make-message-buffer
(function).
make-octects
(function).
make-octects-permissions
(function).
maximum-read-buffer-size
(function).
next-fid
(function).
next-tag
(function).
octects
(class).
octects=
(generic function).
permissions
(structure).
permissions->list
(function).
permissions->string
(function).
permissions-p
(function).
send-message
(function).
send-version
(function).
size
(reader method).
(setf size)
(writer method).
stat
(structure).
stat-p
(function).
symbol->file-type-number
(function).
tags-exists-p-clsr
(function).
universal->unix
(function).
unix->universal
(function).
value
(reader method).
(setf value)
(writer method).
vcat
(function).
with-callback-read-all
(macro).
Packages are listed by definition order.
purgatory.filesystem-utils
common-lisp
.
*directory-sep-regexp*
(special variable).
backreference-dir-p
(function).
cat-parent-dir
(function).
getenv
(function).
loopback-reference-dir-p
(function).
parent-dir-path
(function).
path-last-element
(function).
path-referencing-dir-p
(function).
split-path-elements
(function).
*directory-sep*
(special variable).
+file-path-regex+
(constant).
purgatory.misc-utils
common-lisp
.
safe-all-but-last-elt
(function).
defcond
(macro).
delete@
(generic function).
gen-delete@
(macro).
idx
(generic reader).
out-of-bounds
(condition).
safe-delete@
(generic function).
seq
(generic reader).
text
(generic reader).
text-error
(condition).
purgatory
common-lisp
.
*buffer-size*
(special variable).
*fid*
(special variable).
*messages-sent*
(special variable).
*tag*
(special variable).
+byte-type+
(constant).
+create-dir+
(constant).
+create-for-exec+
(constant).
+create-for-read+
(constant).
+create-for-read-write+
(constant).
+create-for-write+
(constant).
+nofid+
(constant).
+nwname-clone+
(constant).
+open-remove-on-clunk+
(constant).
+open-truncate+
(constant).
+standard-socket-port+
(constant).
+version+
(constant).
9p-attach
(generic function).
9p-auth
(function).
9p-clunk
(function).
9p-create
(function).
9p-error
(condition).
9p-open
(function).
9p-read
(function).
9p-remove
(function).
9p-stat
(function).
9p-walk
(function).
9p-write
(generic function).
change-access-time
(function).
change-mode
(function).
change-modify-time
(function).
change-permissions
(function).
change-time-values
(function).
clone-fid
(function).
close-client
(function).
collect-directory-children
(function).
collect-tree
(function).
copy-file
(function).
create-directory
(function).
create-path
(function).
decode
(generic function).
decode-read-reply
(function).
decode-rstat
(function).
decode-string
(generic function).
dummy-callback
(function).
dump-callback
(function).
encode
(generic function).
encode-string
(function).
initialize-session
(function).
make-permissions
(function).
make-stat
(function).
mount
(function).
move-file
(function).
open-directory
(function).
open-path
(function).
path-exists-p
(function).
path-info
(function).
permissions-group
(reader).
(setf permissions-group)
(writer).
permissions-group-string
(reader).
(setf permissions-group-string)
(writer).
permissions-original-value
(reader).
(setf permissions-original-value)
(writer).
permissions-others
(reader).
(setf permissions-others)
(writer).
permissions-others-string
(reader).
(setf permissions-others-string)
(writer).
permissions-user
(reader).
(setf permissions-user)
(writer).
permissions-user-string
(reader).
(setf permissions-user-string)
(writer).
read-all-pending-messages
(function).
read-all-pending-messages-ignoring-errors
(function).
read-directory
(function).
read-entire-file-apply-function
(function).
read-message
(function).
remove-path
(function).
slurp-file
(function).
sort-dir-stats
(function).
stat-atime
(reader).
(setf stat-atime)
(writer).
stat-entry-size
(reader).
(setf stat-entry-size)
(writer).
stat-entry-type
(reader).
(setf stat-entry-type)
(writer).
stat-group-id
(reader).
(setf stat-group-id)
(writer).
stat-kdev
(reader).
(setf stat-kdev)
(writer).
stat-ktype
(reader).
(setf stat-ktype)
(writer).
stat-last-modified-from-id
(reader).
(setf stat-last-modified-from-id)
(writer).
stat-mode
(reader).
(setf stat-mode)
(writer).
stat-mtime
(reader).
(setf stat-mtime)
(writer).
stat-name
(reader).
(setf stat-name)
(writer).
stat-path
(reader).
(setf stat-path)
(writer).
stat-size
(reader).
(setf stat-size)
(writer).
stat-user-id
(reader).
(setf stat-user-id)
(writer).
stat-version
(reader).
(setf stat-version)
(writer).
truncate-file
(function).
with-new-fid
(macro).
with-new-tag
(macro).
%9p-walk-self
(function).
*rattach*
(special variable).
*rauth*
(special variable).
*rclunk*
(special variable).
*rcreate*
(special variable).
*rerror*
(special variable).
*rflush*
(special variable).
*ropen*
(special variable).
*rread*
(special variable).
*rremove*
(special variable).
*rstat*
(special variable).
*rversion*
(special variable).
*rwalk*
(special variable).
*rwrite*
(special variable).
*rwstat*
(special variable).
*tattach*
(special variable).
*tauth*
(special variable).
*tclunk*
(special variable).
*tcreate*
(special variable).
*terror*
(special variable).
*tflush*
(special variable).
*topen*
(special variable).
*tread*
(special variable).
*tremove*
(special variable).
*tstat*
(special variable).
*tversion*
(special variable).
*twalk*
(special variable).
*twrite*
(special variable).
*twstat*
(special variable).
*unix-epoch-difference*
(special variable).
+9p-read-header-fixed-size+
(constant).
+9p-write-header-fixed-size+
(constant).
+file-types+
(constant).
+message-length-size+
(constant).
+message-string-length-size+
(constant).
+message-tag-size+
(constant).
+message-type-size+
(constant).
+stat-type-append+
(constant).
+stat-type-auth+
(constant).
+stat-type-dir+
(constant).
+stat-type-excl+
(constant).
+stat-type-exec+
(constant).
+stat-type-file+
(constant).
+stat-type-mount+
(constant).
+stat-type-read+
(constant).
+stat-type-symlink+
(constant).
+stat-type-tmp+
(constant).
+stat-type-write+
(constant).
+wstat-ignore-1+
(constant).
+wstat-ignore-2+
(constant).
+wstat-ignore-4+
(constant).
+wstat-ignore-8+
(constant).
9p-authorization-error
(condition).
9p-initialization-error
(condition).
9p-wstat
(generic function).
add-size
(function).
append-tag-callback
(function).
big-endian->little-endian
(function).
bytes->int
(function).
cat-reply-vector
(function).
change-time
(function).
close-ssl-socket
(function).
compose-message
(function).
connection-data
(generic reader).
copy-permissions
(function).
copy-stat
(function).
decode-permissions
(function).
decode-quid
(function).
displace-response
(function).
encode-permissions
(function).
encoded-string-offset
(function).
error-response-p
(function).
error-value
(generic reader).
exhausted-stream-for-read-p
(function).
file-type-number->symbol
(function).
fire-response
(function).
gen-intn->bytes
(macro).
ignore-response
(function).
int16->bytes
(function).
int32->bytes
(function).
int416->bytes
(function).
int512->bytes
(function).
int64->bytes
(function).
int8->bytes
(function).
make-message-buffer
(function).
make-octects
(function).
make-octects-permissions
(function).
maximum-read-buffer-size
(function).
message-type
(generic reader).
next-fid
(function).
next-tag
(function).
octects
(class).
octects=
(generic function).
permissions
(structure).
permissions->list
(function).
permissions->string
(function).
permissions-p
(function).
rtag
(generic reader).
send-message
(function).
send-version
(function).
size
(generic reader).
(setf size)
(generic writer).
stat
(structure).
stat-p
(function).
symbol->file-type-number
(function).
tag
(generic reader).
tags-exists-p-clsr
(function).
universal->unix
(function).
unix->universal
(function).
value
(generic reader).
(setf value)
(generic writer).
vcat
(function).
with-callback-read-all
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Useful convenience macro to generate a new fid
Note: path is relative to root, see attach,
Also note that successfully creating a file will open it.
Note: before opening you have to ’walk’ the file to get the corresponding fid.
Make a new fid that points to the same resource pointed by ‘fid’
Collect all the directory entries of ‘path’ relative to ‘root-fid’ as a list of ‘stat‘ structures.
Traverse the file system tree starting at ‘starting-directory’
returning two values
- a list of strings representing the paths of all the *files*
under ‘starting-directory’
- a list of all the path to the sub-directories under ‘starting-directory’
The lists are ordered in topological order (depth first strategy).
Copy a file pointed by ‘path-from’ to a file pointed by ‘path-to’.
‘progress-fn’, if defined, must be a function with a single
parameter: the number of octects wrote in a single call of the
Twrite command.
Note: the destination file is overwritten if does exists.
Create a new directory with name ‘directory-name’ under the directory pointed by ‘parent-fid’. The parameter ‘permissions’ must be provided in octal (default: #o760))
Create a file or directory as specified by ‘path’.
To create a directory specify a path terminating with a ’/’. Parent
directories are created if do not exist. The parameter ‘permissions’
must be provided in octal (default: #o640))
Returns the fid to the last element of ‘path’
If the last element of ‘path’ is a directory the directory is created
with permissions: #o760.
It ‘path’ already reference a valid file it is opened for read and
write.
Finally if already reference a valid directory is opened for read only.
Decode a serialized file/directory entry in a structure ‘stat’.
A callback that does nothing
A callback that print the data on the standard output, useful for debugging
Initialize the connection to the server using ‘root-path’ as the
root of the remote file system
If ‘username’ is not nil ‘authorization-handshake’ must be a function
of two parameters
- stream
- authorization-fid
The user can write and read to authorization-fid using ‘9p-write’ or
‘9p-read’ to be authorized. If authorized ‘authorization-handshake’
must returns a non nil value. If returns a nil value this is
interpreted as access not granted and ‘mount’ returns nil.
If mount has success two values are returned: the fid of the root file system and the protocol version.
Move the file from ‘path-from‘ ‘path-to‘, this function can be used to rename a file too.
Open the directory pointed to ‘path’ relative to ‘root-fid’.
Returns the fid of the directory pointed by ‘path’.
This fid can be used by ‘read-directory‘ to get the directory entries (see the struct ‘stat’)
Open a full, existing, path relative to ‘root-fid’. ‘Mode’ must be one of +create-for-read+, +create-for-write+, +create-for-read-write+
Returns non nil if ‘path’ exists.
If returns non nil values a stat structure representing the element pointed by ‘path’ and a list of stats structures corresponding to the directory of ‘path’.
user
.
The responses from the server are not processed immediately, they are collected until this function is called.
Read all the messages from the server and ignore any error
Read the next entry of a directory specified by ‘dir-fid’.
‘Dir-fid’ is usually the values returned by ‘open-directory‘.
This function on success returns tree values:
- dir-fid to read the next entry or to check if there are no more
entries (see below);
- the stat struct for the current entry;
- an offset to the next entry.
Each call to this function on the same directory fid, except the first, must use the offset returned by the last call, for example
(let* ((dir-fid (open-directory stream root-fid path))
(multiple-value-bind (next-dir-fid stat stat-size)
(read-directory stream dir-fid) ; offset 0 on the first call
(multiple-value-bind (next-dir-fid-2 stat-2 next-stat-size-2)
(read-directory stream dir-fid stat-size) ; offset equals
; to stat-size
; from previous
; call
...))))
When this function returns nil there no more entries for this
directory (see the code of directory children).
Read an entire file pointed by ‘path’ applying the function ‘read-function’
to three arguments:
- the data chunk as a vector of (unsigned-byte 8);
- the offset to the start of the chunk red;
- the length of the chunk.
Note: ‘path’ is relative to ‘root-fid’
Note also that a failed assertion is signalled if ‘buffer-size’ is
bigger than:
*buffer-size* - +9p-read-header-fixed-size+
Remove the last element of ’path’ relative to ‘root-fid’. If ‘path’ does not exists this function does nothing.
Read in a vector of (unsigned-byte 8) the full content of
’path’ relative to ‘root-fid’
Note: a failed assertion is signalled if ‘buffer-size’ is bigger than:
*buffer-size* - +9p-read-header-fixed-size+
Sort a list of stat struct ‘data’ (by default sorting entry names in lexicographic ascending order
kdev
.
mode
.
name
.
path
.
size
.
Truncate the size of the element pointed by ‘path’ to the size indicated by the value of ‘new-size’ (default 0). Note that only files could be truncated, not directory.
string
) &key username callback afid) ¶mode bit for append only files
mode bit for authentication file
mode bit for directories
mode bit for exclusive use files
mode bit for execute permission
mode bit for non-backed-up files
mode bit for mounted channel
mode bit for read permission
mode bit for non-backed-up files
mode bit for non-backed-up files
mode bit for write permission
Convenience function to convert a vector of bytes to a number using the correct bytes order.
Generate a fresh fid
vector
) &key callback) ¶9p-authorization-error
)) ¶out-of-bounds
)) ¶idx
.
9p-initialization-error
)) ¶rtag
.
Return sequence if position is out of bound
sequence
) position) ¶out-of-bounds
)) ¶seq
.
text-error
)) ¶text
.
Error for 9p protocol in the authorization phase.
error
.
:connection-data
This slot is read-only.
Error for 9p protocol in the initialization phase.
Error when you go out of bound
error
.
Error that set text
error
.
text
.
structure-object
.
purgatory::+wstat-ignore-4+
structure-object
.
purgatory::+wstat-ignore-2+
purgatory::+wstat-ignore-2+
purgatory::+wstat-ignore-4+
:do-not-care
purgatory::+wstat-ignore-4+
purgatory::+wstat-ignore-8+
(purgatory:make-permissions)
purgatory::+wstat-ignore-4+
purgatory::+wstat-ignore-4+
purgatory::+wstat-ignore-8+
""
""
""
""
Jump to: | %
(
9
A B C D E F G I L M N O P R S T U V W |
---|
Jump to: | %
(
9
A B C D E F G I L M N O P R S T U V W |
---|
Jump to: | *
+
A C E G I K L M N O P R S T U V |
---|
Jump to: | *
+
A C E G I K L M N O P R S T U V |
---|
Jump to: | 9
C F M O P S T |
---|
Jump to: | 9
C F M O P S T |
---|