-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathREADME.Rmd
96 lines (67 loc) · 2.1 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# zip
> Cross-Platform 'zip' Compression
<!-- badges: start -->
[![R-CMD-check](https://github.com/r-lib/zip/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/zip/actions/workflows/R-CMD-check.yaml)
[![](https://www.r-pkg.org/badges/version/zip)](https://www.r-pkg.org/pkg/zip)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/zip)](https://www.r-pkg.org/pkg/zip)
[![Codecov test coverage](https://codecov.io/gh/r-lib/zip/graph/badge.svg)](https://app.codecov.io/gh/r-lib/zip)
<!-- badges: end -->
## Installation
Stable version:
```{r eval = FALSE}
install.packages("zip")
```
Development version:
```{r eval = FALSE}
pak::pak("r-lib/zip")
```
## Usage
```{r, include = FALSE, echo = FALSE, results = "hide"}
library(zip)
```
```{r}
library(zip)
```
### Creating ZIP files
`zip()` creates a new ZIP archive. (It overwrites the output file if it
exists.) Simply supply all directories and files that you want to include
in the archive.
It makes sense to change to the top-level directory of the files before
archiving them, so that the files are stored using a relative path name.
```{r}
zip("sources.zip", c("R", "src"))
file.info("sources.zip")
```
Directories are added recursively by default.
`zip_append()` is similar to `zip()`, but it appends files to an existing
ZIP archive.
### Listing ZIP files
`zip_list()` lists files in a ZIP archive. It returns a data frame:
```{r}
zip_list("sources.zip")
```
### Uncompressing ZIP files
`unzip()` uncompresses a ZIP archive:
```{r}
exdir <- tempfile()
unzip("sources.zip", exdir = exdir)
dir(exdir)
```
### Compressing and uncompressing in background processes
You can use the `zip_process()` and `unzip_process()` functions to
create background zip / unzip processes. These processes were implemented
on top of the `processx::process` class, so they are pollable.
## License
MIT