hardlink

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileID added in v1.13.0

type FileID struct {
	Dev uint64
	Ino uint64
}

FileID uniquely identifies a physical file on disk. On Unix, this is the (device, inode) pair. This type is comparable and can be used as a map key without allocations.

func GetFileID added in v1.13.0

func GetFileID(fi os.FileInfo, _ string) (FileID, uint64, error)

GetFileID returns the FileID and link count for a file without allocations. This is more efficient than LinkInfo when you don't need the string representation.

func (FileID) Bytes added in v1.13.0

func (f FileID) Bytes() []byte

Bytes returns a byte slice representation of the FileID for hashing. This is used for computing file signatures across platforms.

func (FileID) IsZero added in v1.13.0

func (f FileID) IsZero() bool

IsZero returns true if the FileID is the zero value (uninitialized).

func (FileID) Less added in v1.13.0

func (f FileID) Less(other FileID) bool

Less returns true if this FileID is less than other. Used for sorting FileIDs.

func (FileID) WriteToHash added in v1.13.0

func (f FileID) WriteToHash(h hash.Hash)

WriteToHash writes the FileID bytes directly to a hash.Hash. Uses a stack-allocated buffer to avoid heap escapes (unlike Bytes which returns a slice).

Jump to

Keyboard shortcuts

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