[][src]Module libpijul::fs

Manipulating the internal representation of files and directories tracked by Pijul (i.e. adding files, removing files, getting file names…).

Pijul tracks files in two different ways: one is the graph, where changes are applied. The other one is the working copy, where some filesystem changes are not yet recorded. The purpose of this double representation is to be able to compare a file from the graph with its version in the working copy, even if its name has changed in the working copy.

The functions of this module work at exactly one of these two levels. Changing the graph is done by recording and applying a change, and changing the working copy is done either by some of the functions in this module, or by outputting the graph to the working copy (using the output module).

Structs

GraphBasenames

An iterator over the basenames of an "inode key" in the graph.

GraphChildren

An iterator over the children (i.e. a single level down) of an inode key in the graph.

WorkingCopyChildren

An iterator over the children (i.e. one level down) of an inode in the working copy.

WorkingCopyIterator

An iterator over all the paths in the working copy.

Functions

find_inode

Find the inode corresponding to that path, or return an error if there's no such inode.

find_path
inode_filename

Find the filename leading from the root to ~inode~.

is_directory

Test whether inode is the inode of a directory (as opposed to a file).

is_tracked

Returns whether a path is registered in the working copy.

iter_basenames

List all the basenames of an "inode key" in the graph (more than one name means a conflict).

iter_graph_children

Returns a list of files under the given key. The root key is pristine::Vertex::ROOT.

iter_paths

Traverse the paths in the graph to a key. Warning: there might be a number of paths exponential in the number of conflicts.

iter_working_copy

Returns an iterator over all the files in the working copy.

move_file

Move an inode (file or directory) from origin to destination, (in the working copy).

move_file_by_inode
remove_file

Removes a file from the repository.

working_copy_children

Returns a list of the children of an inode, in the working copy.