Extract files from or list a zip archive.
unzip(zipfile, files = NULL, list = FALSE, overwrite = TRUE,
junkpaths = FALSE, exdir = ".", unzip = "internal",
setTimes = FALSE)
The pathname of the zip file: tilde expansion (see
path.expand
) will be performed.
A character vector of recorded filepaths to be extracted: the default is to extract all files.
If TRUE
, list the files and extract none. The
equivalent of unzip -l
.
If TRUE
, overwrite existing files (the equivalent
of unzip -o
), otherwise ignore such files (the equivalent of
unzip -n
).
If TRUE
, use only the basename of the stored
filepath when extracting. The equivalent of unzip -j
.
The directory to extract files to (the equivalent of
unzip -d
). It will be created if necessary.
The method to be used. An alternative is to use
getOption("unzip")
, which on a Unix-alike may be set to the
path to a unzip
program.
logical. For the internal method only, should the file times be set based on the times in the zip file? (NB: this applies to included files, not to directories.)
If list = TRUE
, a data frame with columns Name
(character) Length
(the size of the uncompressed file, numeric)
and Date
(of class "POSIXct"
).
Otherwise for the "internal"
method, a character vector of the
filepaths extracted to, invisibly.
unz
to read a single component from a zip file.
zip
for packing, i.e., the “inverse” of unzip()
;
further untar
and tar
, the corresponding
pair for (un)packing tar archives (“tarballs”) such as R
source packages.