https://github.com/hymkor/zar
tarlike zipclone
https://github.com/hymkor/zar
go golang golang-application golang-tools tar zip
Last synced: about 1 year ago
JSON representation
tarlike zipclone
- Host: GitHub
- URL: https://github.com/hymkor/zar
- Owner: hymkor
- License: mit
- Created: 2021-03-27T13:53:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T02:48:36.000Z (over 3 years ago)
- Last Synced: 2025-02-10T15:50:57.597Z (over 1 year ago)
- Topics: go, golang, golang-application, golang-tools, tar, zip
- Language: Go
- Homepage:
- Size: 87.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
zar
===
`zar` is the zip-clone with tar-interface.
[Download binaries](https://github.com/hymkor/zar/releases)
( To install with scoop-installer, type `scoop install https://raw.githubusercontent.com/hymkor/zar/master/zar.json` )
Motivation
----------
- I often forget `-r` option on the native zip-interface
- I prefer the tar-interface. But my colleagues do not know tar-archives. I have to use zip-archives.
- I want to know the filenames are encoded by UTF8 or not ?
- The fifth field of the output that `zar tvf` indicates the encoding of the filename.
- `U` ... UTF8
- `A` ... NonUTF8(ANSI)
- Are The files contained correctly ?
- `zar --md5 -tvf` show md5 checksum of contained files
- `zar --sha1 -tvf` show sha1 checksum of contained files
- `zar --sha256 -tvf` show sha256 checksum of contained files
```
$ zar --md5 -tvf zar-noversion-linux-amd64.zip
b52fa7c45800545279d3a8264484386b -rw-rw-rw- 694516 2021/10/23 00:28 U zar
```
Create an archive
-----------------
- `zar cvf ARCHIVE.zip [files...]`
- `zar cvf - [files...] > ARCHIVE.ZIP`
The filename encoding is always set as UTF8.
### Option
- `--remove-files` removes files from disk after adding them to the archive.
- `-C DIRECTORY` change directory
List an archive
----------------
- `zar tvf ARCHIVE.zip [files...]`
- `zar tvf - [files...] < ARCHIVE.ZIP` \*
### Option
- `--md5` show MD5SUMs of contained files
Extract an archive:
-------------------
- `zar xvf ARCHIVE.zip [files...]`
- `zar xvf - [files...] < ARCHIVE.ZIP` \*
---
- Reading the archive file from STDIN is slow because the ZIP file has the file list in the tail of the archive and we have to make a temporary file to access randomly.
- By golang's "archive/zip" package.
