zar

command module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

zar

zar is the zip-clone with tar-interface.

Download binaries ( 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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址