JustBash.FS.Special (JustBash v0.4.0)
View SourceDevice nodes the filesystem layer services itself, rather than storing them in a backend.
/dev/null is the one device the shell already handled on the write
side of redirection (> /dev/null discards). It did not exist in the
VFS, so cat /dev/null and test -e /dev/null failed even while
cat < /dev/null succeeded. Resolution consults this table so the
read side, the write side, and the operand side agree.
/dev is the directory that holds it. Without that node, tee /dev/null
would fail looking up the parent, and ls /dev would report the path
missing. Other /dev nodes (zero, stdin, stdout, stderr) are
not in the table; add them here if the same invariant ever needs them.
Summary
Functions
Virtual children a special path (or /) contributes to readdir.
Look up a normalized path in the special-file table.
Merge special children into a backend listing.
True when a normalized path is the null device.
Types
Functions
Virtual children a special path (or /) contributes to readdir.
/ lists dev so the directory that holds /dev/null is visible;
/dev lists null.
Look up a normalized path in the special-file table.
Callers must pass a path that JustBash.FS.normalize_path/1 has already
rooted and collapsed, so /dev/./null and /dev/null name the same node.
Merge special children into a backend listing.
Only paths that contribute children (/ and /dev) are uniq-sorted.
Every other directory returns entries in the backend's order, so
ls of an unrelated path is not a drive-by sort.
True when a normalized path is the null device.
@spec readlink(kind(), String.t()) :: {:error, VFS.Error.t()}
@spec refuse_create(String.t()) :: {:error, VFS.Error.t()}
@spec refuse_link(kind(), String.t()) :: {:error, VFS.Error.t()}
@spec rm(kind(), String.t()) :: {:error, VFS.Error.t()}
@spec stat(term(), kind(), String.t()) :: {:ok, VFS.Stat.t(), term()}
@spec stream_read(term(), kind(), String.t(), keyword()) :: {:ok, Enumerable.t(), term()} | {:error, VFS.Error.t()}