4 releases

0.2.2 Nov 15, 2024
0.2.1 Oct 2, 2024
0.2.0 Sep 17, 2024
0.1.0 May 27, 2024

#182 in Operating systems

Download history 23/week @ 2024-08-31 13/week @ 2024-09-07 148/week @ 2024-09-14 27/week @ 2024-09-21 186/week @ 2024-09-28 33/week @ 2024-10-05 9/week @ 2024-10-12 2/week @ 2024-10-19 1/week @ 2024-10-26 61/week @ 2024-11-09 70/week @ 2024-11-16 14/week @ 2024-11-23 8/week @ 2024-11-30

153 downloads per month
Used in 3 crates (2 directly)

MIT license

92KB
2K SLoC

ninep :: a simple 9p protocol implementation

9P is a network protocol developed at Bell Labs for the Plan 9 from Bell Labs distributed operating system as the means of accessing and manipulating resources and applications transparently in a distributed environment. 9P works both as a distributed file system and as a network transparent and language agnostic ‘API’.

The section 5 man pages from plan 9 cover the protocol.

A simple demo

The examples/server.rs file contains a minimal filesystem that demos the functionality provided by this crate. You can use the 9p command from https://github.com/9fans/plan9port to interact with the server and test it out.

See the 9p man page for more information on how the tool works

# Let 9p know where to find the socket we have opened
$ export NAMESPACE="/tmp/ns.$USER.$DISPLAY"

# List the contents of the filesystem and read the contents of a file
$ 9p ls ninep-server
$ 9p read ninep-server/foo

# List the contents of a subdirectory and a file in that subdirectory
$ 9p ls ninep-server/bar
$ 9p read ninep-server/bar/baz

# Read and then update the contents of a file
$ 9p read ninep-server/rw
$ echo "updated" | 9p write ninep-server/rw
$ 9p read ninep-server/rw

A non-trivial filesystem

The ad text editor provides a full virtual filesystem interface in the style of plan9's acme text editor via its fsys module.

Dependencies

~105KB