zip: Create a zip archive.

Description Usage Arguments Value Warning Todo Author(s)

Description

This function creates zip archives, either of single files, multiple files, a single directory, multiple directories, or combinations of files and directories. Currently, recurse=TRUE, which you'll only want to disable if you really don't want directories to be recursed into (ie it's ok to leave recurse=TRUE if you only have a bunch of files to compress.)

Usage

1
zip(x, zip.file, recurse = TRUE, store = FALSE, quiet = TRUE)

Arguments

x

a vector of file or dir names.

zip.file

the name (including the path) of the zip file to be created. Should end in .zip or .ZIP

recurse

logical: recurse into directories? (-r)

store

logical: store only? (-0), i.e., do not compress.

quiet

logical: quiet operation (-q)

Value

none. a zip file archive is made.

Warning

If you specify a vector of filenames, if they are not all in the same directory, then the resulting archive preserves those different directory paths. i.e., when you unzip the archive, you will get a minimal representation of the filesystem that captures the different paths of the files. You should copy files into the same directory, then zip them if you do not want this behaviour! NB this copies the default behaviour of using zip on the command line. Tested on OSX using Zip 2.32 from the Info-ZIP team, which exists at /usr/bin/zip both on OSX (10.5), and solaris 10.

Todo

just like options("unzip"), implement an options("zip")

Author(s)

Mark Cowley, 2009-10-15


drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.