fsutil

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fsutil provides safe and configurable filesystem traversal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Path string // absolute file path
	Size int64  // size in bytes
}

FileInfo represents a file to be analyzed.

func Walk

func Walk(opts WalkOptions) ([]FileInfo, error)

Walk recursively walks the filesystem and returns files that match the options.

type WalkOptions

type WalkOptions struct {
	RootDir            string   // root path to start scanning from
	ExcludedPaths      []string // relative paths to exclude (subdirs or globs)
	AllowedExtensions  []string // file extensions to include (e.g. .go)
	MaxFileSizeBytes   int64    // maximum allowed file size in bytes
	FollowSymlinks     bool     // whether to follow symbolic links
	IncludeHiddenFiles bool     // whether to include dotfiles
}

WalkOptions defines parameters for walking the file tree.

Jump to

Keyboard shortcuts

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