Documentation
¶
Index ¶
- func DosEpoch(t time.Time) bool
- func Print(out io.Writer, lastMod bool, count int, path string, find Find)
- func TarArchive(path string) bool
- func ZipArchive(path string) bool
- type Config
- func (opt Config) Archiver(pattern, path string) ([]Find, error)
- func (opt Config) Copier(out io.Writer, path string)
- func (opt Config) Match(pattern, filename string, isDir bool) (bool, error)
- func (opt Config) Print(out io.Writer, count int, path string)
- func (opt Config) Tars(pattern, path string) ([]Find, error)
- func (opt Config) Update(dir fs.DirEntry, count int, path string, oldest, newest *Match)
- func (opt Config) Walk(out io.Writer, count int, pattern, root string) (int, error)
- func (opt Config) Walks(w io.Writer, pattern string, roots ...string) error
- func (opt Config) Zips(pattern, path string) ([]Find, error)
- type Find
- type Match
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DosEpoch ¶ added in v1.2.0
DosEpoch checks if the time is before the MS-DOS epoch.
However due to false positives created by systems that lacked a real-time clock, it treats Epoch as the 1 February 1980, and not 1 January, 1980.
Types ¶
type Config ¶
type Config struct {
Archive bool
Casesensitive bool
Count bool
Directory bool
Follow bool
LastModified bool
Oldest bool
Newest bool
Panic bool
StdErrors bool
Destination string
NumWorkers int
Sort fastwalk.SortMode
}
Config is the configuration for the ls command.
func (Config) Archiver ¶
Archiver reads the index of a tar or zip archive and returns the matched filenames to the pattern.
func (Config) Copier ¶
Copier copies the file to the destination directory path. The out writer is used to print the errors.
func (Config) Tars ¶
Tars reads the index of the tar archive and returns the matched filenames to the pattern.
func (Config) Update ¶ added in v1.2.0
Update the oldest and newest matches with the count, filename, path and file info. If the oldest and newest flags are not set or there is an error, the function exits.
func (Config) Walk ¶
Walk the root directory to match filenames to the pattern and writes the results to the out writer. The counted finds is returned or left at 0 if not counting.
type Match ¶ added in v1.2.0
type Match struct {
Count int // Count of matches.
Path string // Path to the matched file.
Fd Find // Find of the matched file.
}
Match is the matched filename and path. It is used when the oldest or newest flags are set.