Extract one or more downloaded .zip, .7z, .tar, or .gz archives,
including .tar.gz files, into shared or separate directories.
Arguments
- file_name
character vector. One or more non-missing, non-empty archive paths, in extraction order.
- directory_to_unzip
character vector. One shared extraction directory or one directory per archive, matched by position to
file_name. Paths must be non-missing and non-empty; other vector lengths are rejected.- unzip
logical(1). Extract the supplied archives. Default is
TRUE.FALSEskips path validation, extraction, and removal.- remove
logical(1). Run
download_remove_zips()once for the complete archive vector after the extraction loop finishes. Default isFALSE; ignored whenunzip = FALSE.
Value
Invisible NULL, for both single and multiple archives and when
unzip = FALSE. Extracted paths and per-file statuses are not returned.
Details
Archives are extracted sequentially. ZIP files use utils::unzip(); .7z,
.tar, and .gz files use archive::archive_extract(). Paths stored inside
each archive are preserved beneath its corresponding extraction directory.
An extraction error stops the remaining extractions and prevents cleanup;
files already extracted remain on disk. Warnings from the extraction
functions are not converted to errors.