ffs

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

README

go-filesystems/ffs

ffs

Go Reference CI

Pure-Go access to the Berkeley Fast File System (FFS) — no root, no external tools, no CGO.

FFS is the same on-disk format that FreeBSD calls UFS: FFSv1 = UFS1 and FFSv2 = UFS2, shared across FreeBSD, NetBSD and OpenBSD. Rather than duplicate the parser, this module is a thin re-export of go-filesystems/ufs, which reads and writes the format. It exists so callers that think in "FFS" terms have a matching import path.

import ffs "github.com/go-filesystems/ffs"

fs, err := ffs.OpenFile("disk.ffs")
if err != nil { /* ... */ }
defer fs.Close()

data, err := fs.ReadFile("/etc/rc.conf")

Support

Everything the ufs driver provides:

Status
Read (FFSv1/UFS1, FFSv2/UFS2) ✅
Write + Mkfs (UFS2) ✅ via ufs
NetBSD / OpenBSD FFS images ✅ (same on-disk format; tested via makefs)

See go-filesystems/ufs for the full capability list and details.

Module

github.com/go-filesystems/ffs

Documentation

Overview

Package ffs reads the Berkeley Fast File System (FFS).

FFS is the same on-disk format that FreeBSD calls UFS: FFSv1 = UFS1 and FFSv2 = UFS2, shared across FreeBSD, NetBSD and OpenBSD. Rather than duplicate the parser, this package is a thin re-export of github.com/go-filesystems/ufs, which reads (and writes) the format. It exists so callers that think in "FFS" terms have a matching import path.

fs, err := ffs.OpenFile("disk.ffs")
data, err := fs.ReadFile("/etc/rc.conf")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS = ufs.FS

FS is an opened FFS/UFS filesystem. It is an alias of the ufs driver's FS.

func Open

func Open(rs io.ReaderAt, size int64) (*FS, error)

Open parses the FFS/UFS superblock from rs (FFSv1/UFS1 or FFSv2/UFS2) and returns a read-only handle. size is the backing image size, or -1 if unknown.

func OpenFile

func OpenFile(path string) (*FS, error)

OpenFile opens path read-only and parses its FFS/UFS superblock.

func OpenRW

func OpenRW(rs io.ReaderAt, wa io.WriterAt, size int64) (*FS, error)

OpenRW opens an FFS/UFS image for read and write.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL