zar

command module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 17 Imported by: 0

README

zar

zar is the zip-clone with tar-interface.

Download binaries

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