Skip to content

Add files to DVS-managed storage

Hashes and copies the specified files into DVS storage.

dvs_add(paths = character(0), message = NULL, glob = NULL, dry_run = FALSE)
ArgumentDescription
pathsFiles to add, or directories to search with glob, relative to the working directory. NULL is the same as character(0). paths or glob is required, and a directory needs glob.
messageA message stored with the files’ metadata, such as why they were added.
globA glob that selects the files to add, such as "*.csv". It runs from the working directory, or from each directory in paths. A file named in paths is added whether or not it matches. * does not cross a path separator, so *.csv matches a.csv but not sub/a.csv. Use **/*.csv to match at any depth.
dry_runIf TRUE, report what would be added without modifying anything.

A tibble with one row per file: path (relative to the project root), outcome, hash (the blake3 hash), size (dvs_bytes), stored_size (dvs_bytes, the size of the copy in storage after compression) and duration_ms (the milliseconds spent on the file). outcome is "copied" when the file was stored and its metadata written, and "present" when dvs already tracked the file at this version. In a dry run it is what would happen, and stored_size is size.

A file that fails does not stop the others. When one fails, the result also has the columns code (the kind of failure, for example "io_error") and error (the reason). That row has NA in outcome, hash, size and stored_size. A path that does not exist raises an error and adds nothing.