This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/utils/html/zip.file.extract.html
zip.file.extract {utils}R Documentation

Extract File from a Zip Archive

Description

This will extract the file named file from the zip archive, if possible, and write it in a temporary location.

Usage

zip.file.extract(file, zipname = "R.zip",
                 unzip = getOption("unzip"), dir = tempdir())

Arguments

file

file name. (If a path is given, see ‘Note’.)

zipname

The file name (not path) of a zip archive, including the ".zip" extension if required.

unzip

character string: the method to be used, an empty string indicates "internal".

dir

directory (“folder”) name into which the extraction happens. Must be writable to the caller.

Details

All platforms support an "internal" unzip: this is the default under Windows and the fall-back under Unix if no unzip program was found during configuration and R_UNZIPCMD is not set.

The file will be extracted if it is in the archive and any required unzip utility is available. It will be extracted to the directory given by dir, overwriting any existing file of that name.

Value

The name of the original or extracted file. Success is indicated by returning a different name.

Note

The "internal" method is very simple, and will not set file dates.

This is a helper function for help, example and data. As such, it handles file paths in an unusual way. Any path component of zipname is ignored, and the path to file is used only to determine the directory within which to find zipname.

Source

The C code uses zlib and is in particular based on the contributed ‘⁠minizip⁠’ application in the zlib sources by Gilles Vollant.

See Also

unzip


[Package utils version 2.9.0 ]