Skip to main content

Module fs

Module fs 

Source
Expand description

Filesystem manipulation functions, ie. directories and contents.

Enums§

FsTree
Recursive representation of a directory tree, ignoring sharing.

Functions§

ls_tree
Given a graph and a directory node in it (usually, but not necessarily, the root directory of a repository), return a recursive list of the contained files and directories.
resolve_name
Given a graph and a directory node, return the node id of a named directory entry located (not recursively) in that directory, if it exists.
resolve_name_by_id
Same as resolve_name, but using a pre-resolved LabelNameId as entry name. Using this function is more efficient in case the same name (e.g., “README.md”) is to be looked up in many directories.
resolve_path
Given a graph and a directory node, return the node id of a directory entry located at a given path within that directory, if it exists.
resolve_path_by_id
Same as resolve_path, but using as path a sequence of pre-resolved LabelNameId-s. Using this function is more efficient in case the same path (e.g., “src/main.c”) is to be looked up in many directories.