Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-lib/zip
Platform independent zip compression via miniz
https://github.com/r-lib/zip
Last synced: 4 days ago
JSON representation
Platform independent zip compression via miniz
- Host: GitHub
- URL: https://github.com/r-lib/zip
- Owner: r-lib
- License: other
- Created: 2017-04-09T01:06:13.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-19T21:25:26.000Z (23 days ago)
- Last Synced: 2024-11-23T23:58:02.924Z (18 days ago)
- Language: C
- Homepage: https://r-lib.github.io/zip/
- Size: 5.73 MB
- Stars: 83
- Watchers: 4
- Forks: 20
- Open Issues: 20
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - r-lib/zip - Platform independent zip compression via miniz (C)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# zip
> Cross-Platform 'zip' Compression
[![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)## 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