taf.unzip: Unzip File

Description Usage Arguments Details Value Note See Also Examples

View source: R/taf.unzip.R

Description

Extract files from a zip archive, retaining executable file permissions.

Usage

1
taf.unzip(zipfile, files = NULL, exdir = ".", unzip = NULL, ...)

Arguments

zipfile

zip archive filename.

files

files to extract, default is all files.

exdir

directory to extract to, will be created if necessary.

unzip

extraction method to use, see details below.

...

passed to unzip.

Details

The default method unzip = NULL uses the external unzip program in Unix-compatible operating systems, but an internal method in Windows. For additional information, see the unzip help page.

Value

No return value, called for side effects.

Note

One shortcoming of the base unzip function is that the default "internal" method resets file permissions, so Linux and macOS executables will return a 'Permission denied' error when run.

This function is identical to the base unzip function, except the default value unzip = NULL chooses an appropriate extraction method in all operating systems, making it useful when writing platform-independent scripts.

See Also

unzip is the base function to unzip files.

TAF-package gives an overview of the package.

Examples

1
2
3
4
5
## Not run: 
exefile <- if(os.unix()) "run" else "run.exe"
taf.unzip("bootstrap/software/archive.zip", files=exefile, exdir="model")

## End(Not run)

TAF documentation built on April 7, 2021, 5:06 p.m.