fileutil

package
v0.412.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuzzyFilter added in v0.3.0

func FuzzyFilter(query string, items []string) []string

FuzzyFilter filters items by query using the same scoring algorithm as fzf. Results are sorted by match quality (best matches first).

func GlobWithDoublestar

func GlobWithDoublestar(pattern, searchPath string, limit int) ([]string, bool, error)

func IsSafeWorkingDirectory added in v0.412.3

func IsSafeWorkingDirectory(dir string) bool

IsSafeWorkingDirectory returns true when dir is safe to scan recursively. It returns false (unsafe) when dir is the filesystem root, the user's home directory, or any ancestor of the home directory, or when the directory contains no recognised project-marker file/folder.

The check is cross-platform: it uses os.SameFile for equality (handles symlinks and case-insensitive filesystems on Windows and macOS) and walks up from the home directory to detect ancestor paths correctly.

func SkipHidden

func SkipHidden(path string) bool

Types

type FileInfo

type FileInfo struct {
	Path    string
	ModTime time.Time
}

Jump to

Keyboard shortcuts

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