Skip to main content

open

Function open 

Source
pub fn open(
    primary: &Path,
    paths: &Paths,
    output: Output,
    only: Option<&[PathBuf]>,
    writable: bool,
    password: Option<&str>,
    reads: &Arc<Reads>,
) -> Result<State>
Expand description

writable is false for anything that only looks, so it works on read-only media and never takes the lock. For a fresh extraction the output folder may already hold other files, but no folder where the archive has a file or the other way round; files the archive would replace are listed by existing. password only matters for encrypted archives; see open_encrypted for the ask-and-retry loop front ends want. What opening reads is counted in reads, which a front end can show from another thread: a compressed tar is read in full here.

only limits a fresh extraction to those entries and the folders among them (see Job::select), which begin then allows only while the archive is kept. A half-extracted archive goes on with the selection its journal records, and one given here must be part of it.