filesystem_fat32

package module
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: BSD-3-Clause Imports: 19 Imported by: 5 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-filesystems/fat32

fat32

Go Reference CI

Pure-Go read/write access to FAT32 filesystem images — no root privileges, no external tools, no CGO.

Supports bare filesystem images and MBR/GPT partitioned disks, full directory traversal, file mutation and filesystem creation.

Support summary

Feature Status Notes
Open / Close ✅ Supports bare images and partitioned disks
Format ✅ Creates FAT32 images
ReadFile ✅ Full file reads supported
Read at an offset ✅ OpenFile(path) → io.ReaderAt + Size() (filesystem.Opener / filesystem.File)
Write at an offset ✅ OpenFile(path) → io.WriterAt + Truncate + Sync (filesystem.WritableFile)
WriteFile ✅ Full file writes supported
MkDir / Delete / Rename ✅ Directory operations supported
ReadLink / Symlinks ⚠️ No FAT32 has no POSIX symlinks
Volume label ✅ Label / SetLabel (filesystem.Labeller)
Truncate ✅ Truncate(path, newSize) (filesystem.Truncater)
Timestamps (set) ✅ Chtimes(path, atime, mtime): mtime written to 2 s (rounded down), atime as the local date; birth time untouched; a zero time leaves the field unchanged; local year outside 1980-2107 is refused with *TimeRangeError (errors.Is(err, ErrTimeOutOfRange)), nothing written. Read back by mtools mdir, volume accepted by fsck_msdos. The driver is a filesystem.MetadataSetter (what SMB/NFS/SFTP servers probe for): Chmod and Chown return ErrNotSupported (wraps errors.ErrUnsupported), since FAT has no mode bits or owners
Timestamps (read) ✅ Times(path) (filesystem.TimesReader): mtime 2 s, atime a date (24 h), birth time 10 ms, no ctime; local wall clock (time.Local); an all-zero or invalid field is "not recorded". Checked against entries written by newfs_msdos + mtools mcopy -m
Grow / Shrink / Resize ✅ filesystem.Resizer — Resize dispatches to Grow or Shrink
Partitioned images ✅ MBR/GPT supported
FAT12 / FAT16 (read) ✅ Open / OpenReader read what newfs_msdos -F 12|16 and mkfs.vfat make below ~33 MiB, including OpenFile + ReadAt; see FAT12 and FAT16
FAT12 / FAT16 (write) ✅ everything, including Resize/Grow/Shrink while the FAT type holds (the FAT grows in place when it must; ErrResizeFAT otherwise; CopyResized makes an other-type copy); the fixed root cannot grow, a full root refuses creates; see FAT12 and FAT16
fsck-clean images ✅ fsck_msdos -n (macOS) and fsck.vfat -n (dosfstools) exit 0 on what the driver writes: .. of a directory under the root holds cluster 0, and the FSInfo free count and next-free hint are exact at format and kept current (written after each directory write and on Close; counted once per open, never per allocation, and never trusted from the image)

FAT12 and FAT16

One driver reads all three variants (Info.Type is FAT12, FAT16 or FAT32). The rules, from Microsoft's FAT specification (fatgen103) and checked against Linux fs/fat/inode.c:

  • a boot sector with BPB_FATSz16 == 0 has the FAT32 layout (Linux does the same); otherwise the variant is decided by the count of data clusters alone, never by the FAT12/FAT16 label: below 4085 is FAT12, below 65525 is FAT16, and a FAT12/16 layout claiming more is refused;
  • the root directory of FAT12/16 is a fixed region of BPB_RootEntCnt entries right after the FATs, not a cluster chain (Info.RootCluster is 0, Info.RootDirOffset is the region); .. of a first-level directory holds cluster 0;
  • FAT12 entries are 12 bits packed (offset = N + N/2, odd N the high 12 bits), and one may straddle a sector boundary; end of chain is >= 0xFF8 / >= 0xFFF8, bad cluster 0xFF7 / 0xFFF7;
  • all geometry is computed in 64 bits and checked against the volume, so a forged BytsPerSec, NumFATs, RootEntCnt or sector count is an error on a 32-bit host too.

Writing works too (since v0.7.0): WriteFile, MkDir, DeleteFile, DeleteDir, Rename, Truncate, SetLabel, and File.WriteAt/Truncate.

  • 12-bit entries are written as a read-modify-write of the packed word, so the neighbouring entry is kept, a sector-straddling entry is no special case, and every FAT copy (NumFATs) is written. There is no FSInfo sector and none is written. Allocation stays inside the volume, below the bad-cluster mark.
  • The fixed root directory never grows. When it is full (long-name entries count against BPB_RootEntCnt), a create or rename into it fails with directory is full and the volume is unchanged.
  • A failed write does not leave a chain dangling: new data is written before the old chain is freed, a directory entry is removed before its clusters are freed, and a shrink writes the entry first. The worst an interruption leaves is clusters in use that nothing references (fsck reclaims them).
  • Resize, Grow and Shrink work on FAT12/16 while the volume keeps its FAT type (sizes are whole sectors). Shrink refuses while a cluster past the new end is in use (nothing is relocated) and leaves the FAT at its size. Grow works even when the FAT must get bigger (v0.10.0): the FAT is made bigger and the fixed root and the data shift forward by the difference, from the end backwards, in 64 KiB chunks; cluster numbers do not change, so no FAT entry, directory entry or chain is rewritten. BPB_TotSec16 is used while the sector count fits 16 bits, else BPB_TotSec32. Refused, with errors.Is(err, ErrResizeFAT) and nothing changed: a resize that would change the type (ErrResizeType: "growing to N clusters would make this FAT16 volume FAT32; copy it into a new image of that size with CopyResized"), a grow too small to keep the clusters the volume has once its FAT has grown, zero or negative sizes, sizes not a multiple of the sector size, and sector counts beyond 32 bits. Crash safety (v0.11.0): a grow that does not need a bigger FAT, and a shrink, leave the old or the new size at any interruption (the boot sector is written last on grow, first on shrink). A grow that moves the layout (FAT12/16/32) is journaled and rolled forward: it records its progress in the last sector of the image, and the next Open / OpenReader over a writer finishes an interrupted grow before it serves the volume, so every interruption ends as the old volume (the record was never written) or the grown one, fsck-clean, every file intact. Until that Open, a tool that does not know the record (fsck_msdos, the kernel) sees a half-moved layout between the first move and the boot-sector write. Over a read-only reader an interrupted volume is refused (ErrReadOnlyReader). A grow too small to leave the record a free sector past the moved layout is refused (ErrGrowTooSmall). With a backing store that has Sync, each chunk of 256 KiB or more is flushed around its record; below that the order holds for a process crash or an I/O error, not a power loss mid-move. CopyResized never touches src at all.
  • CopyResized does what an in-place resize cannot (v0.9.0): another FAT type, or a grow that leaves src untouched. CopyResized(dst, size, src, CopyConfig{}) formats dst fresh at size (the FAT type follows from the cluster count as in mkfs.fat; CopyConfig.Type forces FAT12/16/32, and an impossible combination is refused), then copies the whole tree of src: names (long ones too), directories, contents, attributes, timestamps and the label. src is only read, so it is unchanged on success and on failure. A tree that does not fit (ErrCopyNoFit) or a root with more entries than a FAT12/16 fixed root (ErrCopyRootFull, naming both counts) is refused before dst is written; if a write fails half-way the error is returned and the boot sector of dst is cleared so it is not taken for a volume.

The test images in testdata/ were formatted by newfs_msdos and populated by mtools (testdata/mkfixtures). After every mutation scenario the image is checked by fsck_msdos -n (or fsck.vfat -n), a structural checker, equality of the FAT copies, and, for one scenario, mtools and a read-only OS mount. FuzzOpenFAT1216 drives the read surface and FuzzWriteFAT1216 a random sequence of mutations; both corpora are committed.

Untrusted input

An image is attacker-controlled data. Every allocation a value in the image can size is bounded before it happens, and a hostile image gets an error, not an out-of-memory kill:

  • a cluster buffer is allocated only after the cluster's last byte has been read, so a small file declaring 512 KiB clusters costs nothing to probe;
  • the logical sector size is 512..4096 (Linux fat_read_bpb); the field is a uint16, and 32768-byte sectors made every cluster buffer 4 MiB;
  • a directory is at most 65536 entries of 32 bytes, 2 MiB (Linux FAT_MAX_DIR_SIZE), however large the cluster;
  • a long file name is at most 255 characters (20 entries of 13); a longer run of long-name entries is not gathered and the file keeps its short name. The parsers used to prepend each entry to everything gathered so far, so a 2 MiB directory of long-name entries copied about 55 GB;
  • Resize reads the first FAT only after proving the whole FAT is in the image (a 128 GiB FAT claim allocated 137 GB before this).

FuzzOpenAndRead drives the read surface; the regression tests are in bombs_test.go.

Limitations

  • FAT32 has no POSIX symlinks, permissions, or ACLs.
  • Filename charset and legacy constraints (8.3 compatibility concerns) may apply in some tooling contexts.
  • Intended for test and tooling scenarios; not recommended as a production POSIX filesystem.

Module

github.com/go-filesystems/fat32

Supported operations

Operation Status
Open / Close ✅ implemented
Format ✅ implemented
Stat ✅ implemented
ListDir ✅ implemented
ReadFile ✅ implemented
OpenFile ✅ implemented (filesystem.Opener)
WriteAt ✅ implemented (filesystem.WritableFile, on the File)
WriteFile ✅ implemented
MkDir ✅ implemented
DeleteFile ✅ implemented
DeleteDir ✅ implemented (recursive; the tree is checked first without recursion, and a directory cycle, a directory reachable twice or nesting deeper than safeio.MaxTreeDepth is refused with safeio.ErrCycle / ErrTooDeep before anything is changed)
Rename ✅ implemented
ReadLink ⚠️ stub — FAT32 has no symlinks

API

Open and Format return the plain filesystem.Filesystem interface (there is no richer exported FS type) — FAT32-specific extras (Info, PartitionOffset, volume label, truncate, resize) are reached by type-asserting to the optional interfaces from github.com/go-filesystems/interface, or to the package's own Info getter.

Format / Open
type FormatConfig struct {
    Label    string
    VolumeID uint32 // 0 = randomly generated
}

func Format(path string, sizeBytes int64, cfg FormatConfig) (filesystem.Filesystem, error)
func Open(imagePath string, partIndex int) (filesystem.Filesystem, error)

// Format without a host file: an image in memory, a WebAssembly page.
// rw must already hold sizeBytes; the metadata regions are zeroed first,
// so a reused buffer is safe.
func FormatImage(rw ReaderWriterAt, sizeBytes int64, cfg FormatConfig) (filesystem.Filesystem, error)
func OpenReader(r io.ReaderAt, size int64) (filesystem.Filesystem, error)
Read / Write

The returned value's Stat / ListDir / ReadFile / WriteFile / MkDir / DeleteFile / DeleteDir / Rename are exactly the filesystem.Filesystem contract — see that package's README for the full signatures.

FAT32-specific extras (type-assert)
// Read part of a file without materialising all of it: OpenFile resolves the
// FAT chain once (cluster numbers, not data) and then serves byte ranges, so a
// 4 KiB read out of a 4 GiB file costs 4 KiB. Required by anything that mounts
// or exports the volume.
if o, ok := fs.(filesystem.Opener); ok {
    f, err := o.OpenFile("/big.bin")
    if err != nil {
        return err
    }
    defer f.Close()
    buf := make([]byte, 4096)
    n, err := f.ReadAt(buf, 1<<30) // io.ReaderAt semantics, exactly
    _, _ = n, err
    _ = f.Size()                   // from metadata; reads nothing

    // ...and write part of one, in place. Without this a positional write can
    // only be ReadFile + splice + WriteFile: the whole file read, reallocated
    // and written back on every request, so writing a file in blocks is
    // quadratic. Measured over a real NFS mount, 2 MiB in 64 KiB blocks took
    // 23 s (90 kB/s) that way.
    if w, ok := f.(filesystem.WritableFile); ok {
        _, err = w.WriteAt(buf, 1<<30) // io.WriterAt semantics, exactly
        _ = w.Truncate(1 << 20)        // grow zero-fills; shrink frees clusters
        _ = w.Sync()                   // fsync(2) on a file-backed image;
                                       // errors.Is(err, ErrSyncUnsupported) when the backing has no Sync (in-memory image)
    }
}
if l, ok := fs.(filesystem.Labeller); ok {
    _ = l.SetLabel("MYVOL")
}
if t, ok := fs.(filesystem.Truncater); ok {
    _ = t.Truncate("/big.bin", 4096)
}
if r, ok := fs.(filesystem.Resizer); ok {
    _ = r.Resize(newSizeBytes) // dispatches to the package's Grow/Shrink
}
if i, ok := fs.(interface{ Info() Info }); ok {
    fmt.Println(i.Info().ClusterSize())
}

Implements

This package implements the filesystem.Filesystem interface defined in github.com/go-filesystems/interface. Callers can treat the value returned by Open/Format as a filesystem.Filesystem to write generic tooling that works across the other filesystem modules in this repository.

Example:

import (
    filesystem "github.com/go-filesystems/interface"
    fsfat "github.com/go-filesystems/fat32"
)

f, _ := fsfat.Open("fat32.img", -1)
defer f.Close()
var fs filesystem.Filesystem = f
_, _ = fs.ListDir("/")

Documentation

Index

Constants

View Source
const MaxLabelLen = 11

MaxLabelLen is the on-disk size of the FAT32 volume label (BS_VolLab, boot-sector offset 71, 11 bytes). The historic FAT convention is to space-pad shorter labels and to keep the label uppercase ASCII; we preserve case and pad with spaces.

Variables

View Source
var ErrCopyNoFit = errors.New("fat32: the tree does not fit the new image")

ErrCopyNoFit is returned (wrapped) when the tree does not fit the new image.

View Source
var ErrCopyRootFull = errors.New("fat32: the root directory needs more entries than the new image's fixed root has")

ErrCopyRootFull is returned (wrapped) when the root directory of the tree needs more entries than the fixed root of a FAT12/16 image has.

View Source
var ErrGrowTooSmall = errors.New("fat32: grow too small to journal the layout move")

ErrGrowTooSmall is returned by Grow when the grow is too small to move the layout crash-safely: the record needs a free sector past the moved data.

View Source
var ErrNotSupported = fmt.Errorf("fat32: the format has no POSIX mode bits or owners: %w", errors.ErrUnsupported)

ErrNotSupported is what Chmod and Chown return: FAT records no owner and no POSIX mode bits (only the read-only, hidden, system and archive attributes), so there is nothing to store. It wraps errors.ErrUnsupported.

View Source
var ErrReadOnlyReader = errors.New("fat32: this filesystem was opened over a reader that cannot be written")

ErrReadOnlyReader is what a write gets when the filesystem was opened over something that can only be read.

View Source
var ErrResizeFAT = errors.New("fat32: this FAT12/FAT16 resize is not supported")

ErrResizeFAT is the parent of every refusal of a FAT12/FAT16 resize; test it with errors.Is. A FAT12/16 volume can be resized only while it keeps its FAT type (see ErrResizeType); its FAT grows with it when it must.

View Source
var ErrResizeFATFull = fmt.Errorf("%w: the FAT is too small for the new size", ErrResizeFAT)

ErrResizeFATFull was returned by Grow (v0.8.0, v0.9.0) when the FAT had no room for the extra clusters. Since v0.10.0 Grow makes the FAT bigger in place and this error is never returned; it stays so that callers that test for it still compile.

View Source
var ErrResizeType = fmt.Errorf("%w: the FAT type would change", ErrResizeFAT)

ErrResizeType is returned when the new size would put the data-cluster count on the other side of a FAT type threshold (4085, 65525): the volume would change type, which needs a reformat, not a resize.

View Source
var ErrSyncUnsupported = fmt.Errorf("fat32: the backing store has no Sync, so durability cannot be promised: %w", errors.ErrUnsupported)

ErrSyncUnsupported is what Sync returns when the volume's backing store is writable but has no Sync of its own (an in-memory image, a caller's bare io.WriterAt). It wraps errors.ErrUnsupported, the way fsync(2) answers EINVAL for an object that cannot be synchronised: the caller learns that durability was NOT established instead of being told it was. A caller that only wants the data written, not durable, may treat it as success with errors.Is(err, ErrSyncUnsupported).

View Source
var ErrTimeOutOfRange = errors.New("fat32: time outside the FAT range 1980-2107")

ErrTimeOutOfRange is what Chtimes returns, wrapped in a *TimeRangeError, for a time the FAT date word cannot hold. FAT has a 7-bit year counted from 1980, so the representable local years are 1980..2107; the driver never clamps.

Functions

func CopyResized added in v0.9.0

func CopyResized(dst ReaderWriterAt, size int64, src filesystem.Filesystem, cfg CopyConfig) (filesystem.Filesystem, error)

CopyResized formats the first size bytes of dst as a new FAT volume and copies the whole tree of src into it: names (long ones too), directories, contents, attributes, timestamps and the volume label. It is the resize that FAT12/16 refuses in place (ErrResizeType): another FAT type needs a new image. (A bigger FAT of the same type is grown in place since v0.10.0.)

src must be a FAT volume opened by this package; it is only read, so it is unchanged whether CopyResized succeeds or fails. cfg.Type picks the FAT type of the new image (the size decides when it is zero; an impossible combination is refused before anything is written). dst is truncated to size when it can be; otherwise it must already hold size bytes.

Refusals happen before dst is written when they can be known: a tree that needs more clusters than the image has (ErrCopyNoFit), a root directory needing more entries than a FAT12/16 fixed root has (ErrCopyRootFull, which names both counts). If a write fails half-way, the error is returned and the boot sector of dst is cleared so that the half-written image is not taken for a volume.

On success the new filesystem is open over dst, as FormatImage returns it; it does not close dst.

func Format

func Format(path string, sizeBytes int64, cfg FormatConfig) (filesystem.Filesystem, error)

Format creates a new FAT32 filesystem in the file at path. The file is created (or truncated) and formatted. sizeBytes must be a multiple of the cluster size (4096) and large enough to hold the reserved area, two FATs, and at least one data cluster.

On success the newly formatted filesystem is opened and returned; the caller must Close it when done.

func FormatImage added in v0.5.1

func FormatImage(rw ReaderWriterAt, sizeBytes int64, cfg FormatConfig) (filesystem.Filesystem, error)

FormatImage creates a new FAT32 filesystem in the first sizeBytes of rw and opens it, with the same layout and size rules as Format.

It is Format without a path: for a caller that has no host file to give -- a WebAssembly page building an image in memory, a test, a partition inside a larger image. rw must already hold at least sizeBytes; FormatImage never grows it.

Unlike Format, which writes a file it has just truncated, FormatImage cannot assume rw reads back as zeros. It therefore writes zeros over every region a FAT32 reader interprets -- the reserved sectors, both FATs and the root directory cluster -- so a reused buffer holding an older volume does not leak entries into the new one. Data clusters are left as they are: they are free in the new FAT, and nothing reads a free cluster.

The returned filesystem reads and writes through rw (see OpenReader); it does not close rw.

func Open

func Open(imagePath string, partIndex int) (filesystem.Filesystem, error)

Open opens imagePath, optionally selecting a partition, and parses the FAT32 BPB.

func OpenReader added in v0.4.0

func OpenReader(r io.ReaderAt, size int64) (filesystem.Filesystem, error)

OpenReader opens the FAT32 filesystem that starts at offset zero of r.

It exists so this driver fits the one shape the rest of go-filesystems agrees on: github.com/go-filesystems/detect's Opener is func(io.ReaderAt, int64) (filesystem.Filesystem, error), and until now this driver could only be opened from a PATH. A caller with an image already open -- a partition inside a disk image, a section of a larger file, an image in memory -- had to write it to a temporary file first, and detect.Register could not be given this driver at all.

There is no partition index: r is expected to begin at the filesystem, which is what detect has just established by reading the magic there. Open remains the way to look through a partition table.

WRITES need an io.WriterAt. A reader that is only a reader gives a filesystem that serves every read and refuses every write with ErrReadOnlyReader -- rather than one that accepts a write and loses it.

The reader is NOT closed by Close: the caller opened it and still owns it. That is the same division as iso9660, squashfs, hfsplus and ufs, whose reader-based constructors have always worked this way.

Types

type CopyConfig added in v0.9.0

type CopyConfig struct {
	// Type forces the FAT type of the new image: FAT12, FAT16 or FAT32. The zero
	// value lets the size decide, as mkfs.fat does. A size that cannot be
	// formatted as the forced type is refused.
	Type FATType
	// RootEntries is BPB_RootEntCnt of a FAT12/16 image: a multiple of 16, 512 when
	// zero. It is ignored for FAT32, whose root directory is a cluster chain.
	RootEntries uint16
	// Label is the volume label (11 bytes at most); the source's when empty.
	Label string
	// VolumeID is the serial number; random when zero.
	VolumeID uint32
}

CopyConfig holds the optional parameters of CopyResized.

type FATType added in v0.6.0

type FATType uint8

FATType is the width of one FAT entry: the variant of the format.

Bibliography: Microsoft, "FAT: General Overview of On-Disk Format" (fatgen103) section "FAT Type Determination" is the rule for FAT12 versus FAT16, and Linux fs/fat/inode.c fat_fill_super (opened 2026-11-01, torvalds/linux master) is the reference implementation of it:

  • the FAT32 layout is recognised by structure: BPB_FATSz16 == 0 and BPB_FATSz32 != 0 ("Must be FAT32");
  • otherwise the CLUSTER COUNT decides, never a label: total_clusters > MAX_FAT12 (4084) is FAT16, else FAT12;
  • the count is (total_sectors - data_start) / sec_per_clus, with data_start = reserved + fats*fat_length + rootdir_sectors, then clamped to what one FAT can address;
  • fatent.c: end of chain is >= 0xFF8 / 0xFFF8 / 0x0FFFFFF8, and the bad cluster mark is 0xFF7 / 0xFFF7 / 0x0FFFFFF7.
const (
	FAT12 FATType = 12
	FAT16 FATType = 16
	FAT32 FATType = 32
)

The three FAT variants. The zero value is treated as FAT32 so that an Info built by hand (as the tests do) keeps meaning what it always meant.

func (FATType) String added in v0.6.0

func (t FATType) String() string

type FormatConfig

type FormatConfig struct {
	// Label is the volume label stored in the BPB (trimmed to 11 bytes).
	Label string
	// VolumeID is the 32-bit volume serial number. A random value is generated when zero.
	VolumeID uint32
}

FormatConfig holds optional parameters for Format. All fields are optional; sensible defaults are used when left at their zero value.

type Info

type Info struct {
	// Type is the FAT variant, decided by the data-cluster count (see FATType).
	Type FATType
	// RootEntries is BPB_RootEntCnt: the capacity of the fixed FAT12/16 root
	// directory, 0 on FAT32.
	RootEntries uint16
	// DataClusters is the number of data clusters of a FAT12/16 volume (0 on
	// FAT32, where the older TotalSectors-based bound is used).
	DataClusters uint32

	OEMName           string
	BytesPerSector    uint16
	SectorsPerCluster uint8
	ReservedSectors   uint16
	FATCount          uint8
	TotalSectors      uint32
	FATSize           uint32
	HiddenSectors     uint32
	RootCluster       uint32
	FSInfoSector      uint16
	BackupBootSector  uint16
	DriveNumber       uint8
	VolumeID          uint32
	VolumeLabel       string
	TypeLabel         string
}

Info holds the fields decoded from the FAT BIOS parameter block. Despite the package name it describes FAT12, FAT16 and FAT32 volumes (see Type).

func (Info) ClusterSize

func (info Info) ClusterSize() uint32

ClusterSize returns the size of one allocation cluster in bytes.

func (Info) DataOffset

func (info Info) DataOffset(partOffset int64) int64

DataOffset returns the absolute byte offset of the first data cluster.

func (Info) FATOffset

func (info Info) FATOffset(partOffset int64) int64

FATOffset returns the absolute byte offset of the first FAT.

func (Info) RootDirOffset

func (info Info) RootDirOffset(partOffset int64) int64

RootDirOffset returns the absolute byte offset of the root directory: its cluster on FAT32, the fixed region after the FATs on FAT12/16.

func (Info) RootDirSectors added in v0.6.0

func (info Info) RootDirSectors() uint32

RootDirSectors is ((BPB_RootEntCnt*32) + (BPB_BytsPerSec-1)) / BPB_BytsPerSec.

type ReaderWriterAt added in v0.5.1

type ReaderWriterAt interface {
	io.ReaderAt
	io.WriterAt
}

ReaderWriterAt is the image FormatImage formats: anything that can be read and written at an offset, such as a buffer in memory.

type TimeRangeError added in v0.13.0

type TimeRangeError struct {
	Field string // "atime" or "mtime"
	Time  time.Time
}

TimeRangeError names the field and the value Chtimes refused.

func (*TimeRangeError) Error added in v0.13.0

func (e *TimeRangeError) Error() string

func (*TimeRangeError) Unwrap added in v0.13.0

func (e *TimeRangeError) Unwrap() error

Directories

Path Synopsis
benchmarks module

Jump to

Keyboard shortcuts

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