Skip to main content
← dvs documentation Rust API reference

add_files

Function add_files 

Source
pub fn add_files(
    files: Vec<PathBuf>,
    paths: &DvsPaths,
    backend: &Backend,
    message: Option<String>,
    compression: Compression,
    dry_run: bool,
    ctx: &OperationContext,
) -> Result<AddReport>
Expand description

Adds files matching a glob pattern to DVS.

The pattern is matched against files relative to cwd. Files are stored with paths relative to repo_root.

Reports to ctx’s observer as it goes: hashing (if any file is hashed, finished also on an error exit), the plan (once storage has been asked what it has, and always before any row), each transfer, and each row as soon as it is final. Once ctx is cancelled no new file starts: files in flight finish (upload and record together), the rest get a cancelled row and no record, except files whose add the server already recorded (see [cancelled_before_start]). A run that fails after a cancel still returns its (empty) cancelled report.