std/io/fs¶
module io.fs
The file system as data: folders, globs over paths, and the entries a
folder holds, with their kinds, sizes and modification times.
Constructing a Folder or a Glob opens, stats and resolves nothing;
the listing operations read the file system, each once, where it is
written, and give a Seq<Entry> in the order of a sorted walk, never
the file system's. A listing is granted exactly where reading a file at
the same path is. A program imports the module, import io.fs, and
reaches it as fs, fs.folder(…), or binds its functions,
from io.fs import *.
Folder— A folder of the file system atpath: an endpoint that holds files and folders, as a database holds tables.Glob— A pattern over paths, matched against a path relative to the folder it is applied to:*matches within one segment,**any number of whole segments,?one character other than/, and[abc]one character of the set,[a-z]one of the range.Entry— One thing a folder holds: itspath, the listed folder's path joined with the entry's path below it, sofile(e.path)reads it; itsname, the last segment; itskind,"file","folder"or"link"; itssize, a file's length in bytes, absent for a folder or a link; and itsmodified, the time the entry was last modified, a link's own and not its target's, absent where the platform does not record one.folder— TheFolderatpath, aStringor aPath.source_dir— The source directory of the unit calling it: the directory holding the program's file, the document of a cell, or the module whose function calls it, and the working directory for a program with no file.working_dir— The working directory: the directoryhqlwas started in.matches— Whetherpath, read as relative to the folder the glob is applied to, matchesself.entries— The entries directly inself, sorted by name, an entry whose name opens with.included.walk— Every entry belowself, the folder itself excluded: depth first, each folder's entries sorted by name, and each folder followed at once by what it holds.glob— The entries ofwalk(self)whose path belowselfmatchespattern, in walk order.exists— Whether something is atself: a file, a folder or a link.entry— TheEntryatself,some(Entry), ornonewhere nothing is there.