fsstat

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package fsstat reads filesystem metadata for a path opened through os.Root.

Platform implementations must keep the filesystem query tied to a rooted handle for the target filesystem and revalidate the target identity. The caller uses ErrPathChanged to retry when a path component becomes a symlink or reparse point during resolution.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotDirectory = errors.New("not a directory")

ErrNotDirectory indicates that a caller-required final target is not a directory.

View Source
var ErrNotSupported = errors.New("not supported on this platform")

ErrNotSupported indicates that the current platform has no filesystem-stat backend.

View Source
var ErrPathChanged = errors.New("path changed during filesystem stat")

ErrPathChanged indicates that a path became a symlink or reparse point after sandbox resolution. Callers should resolve the original path again.

Functions

This section is empty.

Types

type Info

type Info struct {
	ID          uint64
	IDAvailable bool

	NameMax          uint64
	NameMaxAvailable bool

	TypeID          uint64
	TypeIDAvailable bool
	TypeName        string

	IOBlockSize          uint64
	FundamentalBlockSize uint64
	Blocks               uint64
	BlocksFree           uint64
	BlocksAvailable      uint64

	Files          uint64
	FilesFree      uint64
	FilesAvailable bool
}

Info is the normalized subset of filesystem metadata used by stat -f.

func Read

func Read(root *os.Root, relPath string, requireDirectory bool) (Info, error)

Read returns filesystem metadata for relPath beneath root. When requireDirectory is true, the identity-checked target must be a directory.

Jump to

Keyboard shortcuts

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