file

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Name        string
	Path        string
	IsDir       bool
	ContainerID string
	DisplayName string
	Size        int64
	Mode        fs.FileMode
	ModTime     time.Time
	// LinkTarget is set for symbolic links.
	LinkTarget string
}
func (i Info) IsSymlink() bool

func (Info) ModTimeString

func (i Info) ModTimeString(now time.Time) string

ModTimeString formats the modification time like ls -l: "Oct 12 14:03" for the last six months, "Oct 12 2025" otherwise.

func (Info) PermString

func (i Info) PermString() string

PermString formats the mode like ls -l, e.g. "drwxr-xr-x" or "lrwxrwxrwx". fs.FileMode.String differs from ls for symlinks ("L") and the special bits.

func (Info) SizeString

func (i Info) SizeString() string

Jump to

Keyboard shortcuts

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