interface
core
The shared filesystem.Filesystem contract every driver implements โ Read/Write/List/Stat/MkDir/Rename and friends. No cgo, no root.
Pure-Go filesystem drivers โ read & write on-disk filesystem images with no cgo and no root.
go-filesystems is a set of independent, dependency-free Go modules that
read and write on-disk filesystem images โ one module per filesystem, all implementing a small
shared contract. Open and inspect an image, mutate it in place, or format a fresh one โ entirely
in Go, with no kernel mount and no C toolchain.
Every driver implements filesystem.Filesystem from
go-filesystems/interface.
type Filesystem interface {
Close() error
ReadFile(path string) ([]byte, error)
ListDir(path string) ([]DirEntry, error)
Stat(path string) (Stat, error)
WriteFile(path string, data []byte, perm os.FileMode) error
ReadLink(path string) (string, error)
MkDir(path string, perm os.FileMode) error
DeleteFile(path string) error
DeleteDir(path string) error
Rename(oldPath, newPath string) error
}The shared contract plus every filesystem driver that actually exists in the org today. Capabilities reflect what each driver implements now, not just what the on-disk format allows.
interface
coreThe shared filesystem.Filesystem contract every driver implements โ Read/Write/List/Stat/MkDir/Rename and friends. No cgo, no root.
cpio
corecpio records โ newc, crc, odc and the old binary variant, both byte orders. Deliberately not a Filesystem: unarchive indexes into a reader it keeps open and rpm has the payload decompressed in memory, so they share the parser and each builds its own filesystem over it.
hostcopy
coreCopies a byte range from one driver's file into another's without holding it in memory โ and without passing it through this process at all when both are files of the host, where it becomes copy_file_range(2). Anything else falls back to ReadAt/WriteAt, so a caller writes one call and gets the kernel's copy when the kernel can do it.
detect
toolblkid-style filesystem-type prober and driver-opener registry โ probes on-disk magic signatures and dispatches to a registered driver. No cgo, no libblkid.
sftp
toolPure-Go SFTP server (draft-ietf-secsh-filexfer-02 v3) exporting any Filesystem over golang.org/x/crypto/ssh โ reachable from every ordinary SFTP client (OpenSSH, Cyberduck, WinSCP, FileZilla, VS Code, gvfs) with nothing installed and nothing mounted. Key auth and encryption included; one image plus one process is the isolation boundary.
nfs
toolNFSv3 server that exports any filesystem.Filesystem โ mountable on macOS, Linux and Windows with no kext, no FSKit entitlement and no root on the server side. A network protocol instead of a kernel module.
webdav
toolWebDAV server (RFC 4918) that exports any filesystem.Filesystem as a net/http.Handler โ browsable in a browser, mountable from the Finder or Explorer, with Basic/Bearer authentication and TLS. Range reads and Content-Range partial writes go through the random-access capabilities.
apfs
driverApple File System โ real APFS on-disk (kext-mountable), GPT-aware. Read, write, format, symlinks, snapshots and container resize.
btrfs
driverCopy-on-write Linux filesystem with snapshots and subvolumes. Single-device, CRC32c (btrfs-progs โฅ 5.x). Read, write, format.
exfat
driverExtended FAT for large removable media. Read, write, format and volume label.
ext4
driverLinux ext4 โ extents, 64-bit block numbers, flex_bg, directory htree, journaling, metadata_csum (CRC32c). Read, write, format, symlinks, online grow/shrink.
fat32
driverFAT with 32-bit allocation โ the cross-platform baseline. Read, write, format and volume label.
hfsplus
driverApple HFS+ / HFSX (Mac OS Extended) โ big-endian catalog + extents-overflow B-trees. Read, write, format.
iso9660
driverISO 9660 / ECMA-119 optical-disc filesystem, plus Rock Ridge (names/perms/symlinks) and Joliet (UCS-2 names). Read-only.
ntfs
driverWindows NT filesystem โ minimal in-image blob model (NOT the real NTFS on-disk format); a separate read-only real-NTFS reader parses the genuine on-disk structures. Read, write, format and volume label.
oci
driverRead-only OCI / Docker image filesystem โ overlays an image's tar layers (whiteouts, opaque directories, hardlinks, symlinks) and serves the merged rootfs through the shared contract. Image-as-filesystem, not an on-disk format.
squashfs
driverCompressed read-only archive filesystem. SquashFS 4.0 with gzip/xz/zstd/lzo/lz4 blocks and fragments. Read and format.
uefi
driverEFI System Partition (FAT-based) plus the OVMF/EDK2 NvVar variable store with time-based authenticated writes. Read, write, format.
ufs
driverUnix File System (BSD) โ UFS2 (FreeBSD 14.x) read+write, UFS1 read. Read, write, format, symlinks.
ffs
driverNetBSD/OpenBSD FFSv1/FFSv2 alias module over the ufs driver. Read, write, format.
xfs
driverHigh-performance journaling filesystem โ XFS v5 (CRC32c, ftype). Read, write, format, symlinks, reflink/quotas and grow/resize.
zfs
driverCopy-on-write pooled storage filesystem โ single pool, single vdev writer (multi-vdev/RAID-Z read-only). Read, write, format, snapshots/clones and grow/shrink.
cab
driverMicrosoft Cabinet (.cab), read as a filesystem โ no cgo.
rar
driverRAR read as a filesystem, including multi-volume sets.
rpm
driverRPM packages โ the lead, the signature and header regions, and the payload.
sevenzip
driver7z through bodgit/sevenzip, and it writes โ the container and the entries.
warc
driverWARC, the ISO 28500 web archive format โ reader and writer.
unarchive
toolExtract any archive, everywhere Go compiles: the format is sniffed from the bytes, not the extension, and volumes are followed.
smb
toolSMB2 server exporting any Filesystem โ mountable on Windows, macOS and Linux.
s3
toolAn S3-compatible object API over any driver here.
osfs
driverA host directory as a Filesystem, confined with os.Root. Every other driver here decodes a format out of an image; this one hands each call to the host kernel, relative to one directory, so a server written against the contract can serve a plain directory without a disk image in the way.
overlay
toolMakes a read-only filesystem writable: changes land in a spool, cheaply, and one rewrite happens when you say so.
xar
driverXAR, the macOS .pkg installer format: a gzip'd XML table of contents and a heap.
Every module is pure Go with CGO_ENABLED=0 and needs no root
privileges and no external mount tooling for normal operation. Each driver speaks the same small
filesystem.Filesystem contract, so callers stay format-agnostic. Drivers are
cross-checked against the real on-disk formats their reference tools produce. BSD-3-Clause throughout.