Documentation
¶
Overview ¶
Package dirent decides whether an entry a reader lists is a folder to go into, links included.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFolder ¶
IsFolder is whether e, an entry listed in dir, is a folder to read into: a folder of its own, or a link that leads to one. os.ReadDir reports a symlink as ModeSymlink and, on Windows, a junction as ModeIrregular (Go 1.23 and later), and neither as IsDir, so a reader that goes into only IsDir() entries, or IsDir() and ModeSymlink ones, walks past a folder kept on another drive with a junction left where it was (#2268). Such an entry is followed with os.Stat. A link to a file, a broken link and anything else irregular are no folder.
It follows only the entry it is asked about. A reader that recurses on it must keep its own record of the folders it has been in.
Types ¶
type Listing ¶ added in v0.1.1664
type Listing []Entry
Listing is a folder's entries in name order. It is a slice, not a map: every 15 s Sessions poll lists every Codex day folder and Claude Code project again, and a map of each folder's entries was ~90 MB of the 2.3 GB eight polls allocated.
func Stats ¶ added in v0.1.1651
Stats is each entry of dir in name order, as os.Lstat gives it, read in a few calls for the whole folder where the system has them (getattrlistbulk on macOS), rather than one per entry. ok is false where the system has none or the folder couldn't be read, and the caller asks after each entry itself.
A caller done reading the listing gives it back (Done) for the next.