EVOLUTION-MANAGER
Edit File: unzip.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Extract or List Zip Archives</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for unzip {utils}"><tr><td>unzip {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Extract or List Zip Archives </h2> <h3>Description</h3> <p>Extract files from or list a zip archive. </p> <h3>Usage</h3> <pre> unzip(zipfile, files = NULL, list = FALSE, overwrite = TRUE, junkpaths = FALSE, exdir = ".", unzip = "internal", setTimes = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>zipfile</code></td> <td> <p>The pathname of the zip file: tilde expansion (see <code><a href="../../base/html/path.expand.html">path.expand</a></code>) will be performed.</p> </td></tr> <tr valign="top"><td><code>files</code></td> <td> <p>A character vector of recorded filepaths to be extracted: the default is to extract all files.</p> </td></tr> <tr valign="top"><td><code>list</code></td> <td> <p>If <code>TRUE</code>, list the files and extract none. The equivalent of <code>unzip -l</code>.</p> </td></tr> <tr valign="top"><td><code>overwrite</code></td> <td> <p>If <code>TRUE</code>, overwrite existing files (the equivalent of <code>unzip -o</code>), otherwise ignore such files (the equivalent of <code>unzip -n</code>).</p> </td></tr> <tr valign="top"><td><code>junkpaths</code></td> <td> <p>If <code>TRUE</code>, use only the basename of the stored filepath when extracting. The equivalent of <code>unzip -j</code>.</p> </td></tr> <tr valign="top"><td><code>exdir</code></td> <td> <p>The directory to extract files to (the equivalent of <code>unzip -d</code>). It will be created if necessary.</p> </td></tr> <tr valign="top"><td><code>unzip</code></td> <td> <p>The method to be used. An alternative is to use <code>getOption("unzip")</code>, which on a Unix-alike may be set to the path to a <code>unzip</code> program.</p> </td></tr> <tr valign="top"><td><code>setTimes</code></td> <td> <p>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.)</p> </td></tr> </table> <h3>Value</h3> <p>If <code>list = TRUE</code>, a data frame with columns <code>Name</code> (character) <code>Length</code> (the size of the uncompressed file, numeric) and <code>Date</code> (of class <code>"<a href="../../base/html/DateTimeClasses.html">POSIXct</a>"</code>). </p> <p>Otherwise for the <code>"internal"</code> method, a character vector of the filepaths extracted to, invisibly. </p> <h3>Note</h3> <p>The default internal method is a minimal implementation, principally designed for Windows' users to be able to unpack Windows binary packages without external software. It does not (for example) support Unicode filenames as introduced in <code>zip 3.0</code>: for that use <code>unzip = "unzip"</code> with <code>unzip 6.00</code> or later. It does have some support for <code>bzip2</code> compression and > 2GB zip files (but not >= 4GB files pre-compression contained in a zip file: like many builds of <code>unzip</code> it may truncate these, in <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>'s case with a warning if possible). </p> <p>If <code>unzip</code> specifies a program, the format of the dates listed with <code>list = TRUE</code> is unknown (on Windows it can even depend on the current locale) and the return values could be <code>NA</code> or expressed in the wrong time zone or misinterpreted (the latter being far less likely as from <code>unzip 6.00</code>). </p> <p>File times in zip files are stored in the style of MS-DOS, as local times to an accuracy of 2 seconds. This is not very useful when transferring zip files between machines (even across continents), so we chose not to restore them by default. </p> <h3>Source</h3> <p>The internal C code uses <code>zlib</code> and is in particular based on the contributed <span class="samp">minizip</span> application in the <code>zlib</code> sources (from <a href="http://zlib.net">http://zlib.net</a>) by Gilles Vollant. </p> <h3>See Also</h3> <p><code><a href="../../base/html/connections.html">unz</a></code> to read a single component from a zip file. </p> <p><code><a href="zip.html">zip</a></code> for packing, i.e., the “inverse” of <code>unzip()</code>; further <code><a href="untar.html">untar</a></code> and <code><a href="tar.html">tar</a></code>, the corresponding pair for (un)packing tar archives (“tarballs”) such as <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> source packages. </p> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>