fsutil

package
v0.0.0-...-8fc8d39 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fsutil provides filesystem utilities for testing purposes

Index

Constants

This section is empty.

Variables

View Source
var DefaultComparisonOpts = ComparisonOpts{
	Name:    true,
	Size:    true,
	Mode:    true,
	Content: true,
}

DefaultComparisonOpts compares only the name, size, dir, and mode of fs.FileInfo

Functions

func DiffFS

func DiffFS(fsA, fsB fs.FS, opts ComparisonOpts) ([]fs.FileInfo, error)

DiffFS returns the differences between two filesystems. (A-B)

func EqualFilesystem

func EqualFilesystem(fsA, fsB fs.FS, opts ComparisonOpts) error

EqualFilesystem checks that the filesystems (excluding hidden files/dirs) are identical. Equality based on comparison options.

func GetInode

func GetInode(fi fs.FileInfo) (uint64, error)

GetInode returns the inode for a file.

Types

type ComparisonOpts

type ComparisonOpts struct {
	Name    bool // Compare name
	Size    bool // Compare size
	Mode    bool // Compare mode
	Content bool // Compare file content
}

ComparisonOpts stores options for comparing file system equality

Jump to

Keyboard shortcuts

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