Module dir

Source
Available on Linux only.
Expand description

Types for interacting with the directories of a file system. Simpler than the file module, this one is primarily focussed on the Directory and DirEntry types.

This module provides the Directory type and associated types, including errors and iterators.

§Opening

With less options relevant while opening Directorys, this module current does not provide a builder like file’s OpenOptions. This may change in the future, if more relevant options are found.

§Access Mode

Unlike Files, Directorys are currently not associated with an access mode to restrict operations at compile time. This may be changed in the future however, if it helps to better represent the underlying entity and its functionality.

Structs§

DirEntries
An iterator over a Directory’s contained entries. Obtainable via Directory::read_entries, this buffered iterator produces DirEntrys for the referenced directory.
DirEntry
An entry in a Directory’s records, taking the form of a reference to the parent Directory and the relative path to this entry, along with a few other pieces of information.
Directory
An open directory that is guaranteed to exist for the lifetime of the Directory. Can also be used to obtain an iterator over each contained DirEntry.

Constants§

CWD
A special constant Directory that always represents to current directory of the process. Can be passed to functions in place of a manually opened Directory to indicate that the operation should use the process’s cwd.