| unzip_process | R Documentation |
unzip_process() returns an R6 class that represents an unzip process.
It is implemented as a subclass of processx::process.
unzip_process()
An unzip_process R6 class object, a subclass of
processx::process, or a subclass of callr::r_process when the fallback
is active (see the Fallback section below).
unzip_process classup <- unzip_process()$new(zipfile, exdir = ".", poll_connection = TRUE,
stderr = tempfile(), ...)
See processx::process for the class methods.
Arguments:
zipfile: Path to the zip file to uncompress.
exdir: Directory to uncompress the archive to. If it does not
exist, it will be created.
poll_connection: passed to the initialize method of
processx::process, it allows using processx::poll() or the
poll_io() method to poll for the completion of the process.
stderr: passed to the initialize method of processx::process,
by default the standard error is written to a temporary file.
This file can be used to diagnose errors if the process failed.
... passed to the initialize method of processx::process.
unzip_process() normally runs the bundled cmdunzip native executable
via processx::process. If the executable cannot be found or fails its
self-test it falls back to running unzip() in a background R process
via callr::r_process. This may happen when system policies do not
allow starting the cmdunzip executable., The fallback class has the
same interface but inherits from callr::r_process instead of
processx::process.
Set the environment variable R_ZIP_PROCESS_FALLBACK=true to force the
fallback unconditionally.
The unzip_process class does not support the encoding argument of
unzip(). Non-UTF-8 filenames are decoded using the IBM CP437 fallback.
Use unzip() directly if you need to handle ZIP files with filenames in
other encodings (e.g. CP932).
ex <- system.file("example.zip", package = "zip")
tmp <- tempfile()
up <- unzip_process()$new(ex, exdir = tmp)
up$wait()
up$get_exit_status()
dir(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.