oaknut-afs
A Python library for reading, writing, and creating Acorn Level 3 File Server (AFS) disc partitions — the private on-disc filesystem the Level 3 File Server served to BBC Micro, Master, and Archimedes clients over Econet.
AFS is a hierarchical, multi-user filesystem: it has real directories, a
per-file owner and public access model, and a $.Passwords file of user
accounts. It is identified by the AFS0 magic in its info sectors.
Part of a dual-partition disc. An AFS filesystem does not occupy a disc alone — it lives in the tail cylinders of an old-map ADFS disc. The real
WFSINITutility (and oaknut'sinitialise()) shrinks the ADFS partition and carves the AFS region out of the space freed. oaknut-afs reads and writes that region; oaknut-adfs handles the host.
Part of the oaknut monorepo.
What it does
- Read and write an AFS partition: browse the directory tree, read and write files, create and remove directories, and edit metadata (owner and public access, the native two-byte datestamp).
- Partition and initialise (
initialise()): theWFSINITanalogue — repartition an old-map ADFS disc and lay down an empty AFS filesystem in the tail, with its map, root, and$.Passwordsfile. - Manage users (
UserSpec,PasswordsFile): create accounts with passwords and disc-space allocations; the built-inSyst,Boot, andWelcomeaccounts are handled. - Import a host tree (
import_host_tree()): populate a new filesystem from a directory of files with.infsidecars. - Merge (
merge()) two AFS partitions, and emplace shipped libraries (SHIPPED_LIBRARIES) such as the standardLibrary.
Passwords are stored as the file server stored them: up to six cleartext ASCII
bytes in $.Passwords, with no encryption — oaknut reproduces the format
faithfully rather than obscuring it.
Installation
uv add oaknut-afs # or: pip install oaknut-afs
oaknut-afs works with any PEP 517 build
front-end and package manager; the examples use
uv.
Usage
Creating and populating a filesystem
from oaknut.afs import AFS, UserSpec
with AFS.create_file(
"server.dat",
capacity="10MB",
disc_name="Server",
users=[UserSpec(name="RJS", quota="2MB")],
) as afs:
# Creating the RJS account also creates its home directory, $.RJS.
(afs.root / "RJS" / "ReadMe").write_text("Welcome to the file server.\n")
Reading
from oaknut.afs import AFS
with AFS.from_file("server.dat") as afs:
for entry in afs.root.iterdir():
print(entry.name)
text = (afs.root / "RJS" / "ReadMe").read_text()
print(text, end="")
Output:
Passwords
RJS
Welcome to the file server.
For dual ADFS + AFS discs, the
disc
CLI reaches the AFS partition through the ADFS host with an afs: prefix
(disc ls 'server.dat:afs:$'), routed by content identification.
Development
The package is developed in the oaknut workspace. From the repository root:
uv sync # install all workspace members editable
uv run pytest packages/oaknut-afs/tests # this package's tests
uv run ruff check # lint
Architecture
oaknut-afs depends on oaknut-adfs (to place and read the partition within its
ADFS host), oaknut-discimage, and oaknut-file, and contributes AFS to the
oaknut.filesystem extension axis so that AFS partitions are identified,
listed, and read through the disc CLI alongside the disc-based filing
systems. Sector-level access comes from
oaknut-discimage;
metadata and the acorn codec from
oaknut-file.
Further reading
- AFS0 on-disc format — Rick Murray's notes on the Level 3 File Server's private format.
- Acorn Econet — the network the file server served over.
License
MIT — see LICENSE.
Metadata
Release files for oaknut-afs 13.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oaknut_afs-13.6.1.tar.gz | 209.9 kB | Without provenance | Details for oaknut_afs-13.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oaknut_afs-13.6.1-py3-none-any.whl | Python 3 | none | any | Details for oaknut_afs-13.6.1-py3-none-any.whl |
Total release size: 369.9 kB
Release files / oaknut_afs-13.6.1.tar.gz
| Download URL | oaknut_afs-13.6.1.tar.gz |
|---|---|
| Size | 209.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b88c025bb640b8ae160748484548da310c28286674128e5247e3700ee0d65f0
|
|
BLAKE2b-256 checksum How to use checksums |
8a519012056daae511b3405e966b1c2fae3144b3db3739e09950c660dd117b44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / oaknut_afs-13.6.1-py3-none-any.whl
| Download URL | oaknut_afs-13.6.1-py3-none-any.whl |
|---|---|
| Size | 160.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
873e2976daa6a0fa5bb97b222c6afdec9d187e6808217fb3831b325e6120dba6
|
|
BLAKE2b-256 checksum How to use checksums |
5095b41936246c1a14813fdfc65352f2d3baa2cb4f9d33403cb3c47d14e2e389
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for oaknut-afs 13.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.