Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandonchinn178/ztar
https://github.com/brandonchinn178/ztar
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/brandonchinn178/ztar
- Owner: brandonchinn178
- License: bsd-3-clause
- Created: 2018-06-18T18:24:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-11T05:47:16.000Z (11 months ago)
- Last Synced: 2024-09-07T06:48:59.093Z (2 months ago)
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/ztar
- Size: 63.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ztar
Reading and writing arbitrary archives.
An extension of the `tar` library that, similar to the `tar` UNIX executable,
can create an archive with a given compression algorithm and automatically
detect the compression algorithm of an archive when extracting.```
import Codec.Archive.ZTar-- equivalent to `Codec.Archive.Tar.create "archive.tar" "dist/" ["."]`
createFrom NoCompression "archive.tar" "dist/" ["."]-- helper to compress a single directory; equivalent to previous line
create NoCompression "archive.tar" "dist/"-- compress with GZip
create GZip "archive.tar.gz" "dist/"-- compress with Zip
create Zip "archive.zip" "dist/"-- automatically determines compression
extract "archive.tar" "archive-tar/"
extract "archive.tar.gz" "archive-gz/"
extract "archive.zip" "archive-zip/"-- can also use Path types
import Path
import Path.IO
home <- getHomeDir
let archive = home > [relfile|archive.tgz|]
dir <- resolveDir "dist/"
create' GZip archive dir
```