Documentation
¶
Overview ¶
Package entry provides functionality for listing directory entries with customizable formatting and cross-platform support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintEntries ¶
PrintEntries prints entries to stdout. It optionally recurses into subdirectories based on Config.Recurse.
Types ¶
type Config ¶
type Config struct { All bool Grid bool Long bool Header bool Recurse bool Size bool Time bool Kind bool Ext bool Reverse bool }
Config holds command-line configuration options for directory listing.
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry represents a file or directory with its metadata.
func ReadEntries ¶
ReadEntries reads and returns a slice of Entries from the specified path.
func (Entry) Name ¶
Name returns the file name of the Entry, quoted if it has special characters or whitespace.
func (Entry) Permission ¶
Permission returns the file permissions of the Entry as a string.
func (Entry) Time ¶
Time returns the formatted modification time of the Entry. Uses "Jan 02 15:04" for current-year entries, "Jan 02 2006" otherwise.
func (Entry) UserAndGroup ¶
UserAndGroup returns the user and group names for the Entry's file info.