stat

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 20 Imported by: 2 modules, 0 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.

Documentation

Overview

Package stat implements the stat core utility, following the GNU manual.

It writes the information the file system holds about each file given, as a default format or one built from the format directives of --format and --printf, and the file system status with -f.

The file system abstraction used here carries no file system statistics, so -f writes every file system field but the name as a question mark, the way GNU writes the values a platform doesn't report. A file whose system information isn't available, like in a memory file system, is written with a device number, a file serial number and a device type of zero, a link count of one, no access-time hint beyond the 512-byte block size, and its blocks measured by its size. The time of the last status change a file system doesn't report is written as the modification time, and the birth time as a question mark for %w and zero for %W. The SELinux context and the mount point are written as a question mark, marking the file as failed the way GNU does.

Timestamps are written in the zone TZ names, or the local zone when TZ is unset; the fixed-offset POSIX forms of TZ, like "EST5", aren't supported and fall back to the local zone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns a new Prog.

Types

type Prog

type Prog struct {
	*coreutils.Runtime
}

Prog is the stat core utility.

func (*Prog) Run

func (p *Prog) Run(ctx context.Context, args ...string) error

Run writes the status of each file named in args, as the options ask for. A file that can't be read is diagnosed and the run goes on, and the run reports failure when any file failed.

Jump to

Keyboard shortcuts

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