arprint

command
v0.0.0-...-a8a07f9 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Print the names and contents of the files in a tar or zip archive. Only makes sense for archives containing only text files.

The archive/tar API doesn't presume random access, and I can't figure out how I could present a facade for tars and zips that gives random access to individual files in the archive without using syscall.Dup or opening a bunch of file descriptors that could possibly be to different files if the filesystem changed. I started out with a program that just detected and printed archive types, which seemed to satisfy most of the spirit of the exercise, but I decided to go a bit further and print file contents. Wrapping an io.Reader like in zip/zip.go and tar/tar.go is awkward and not that useful, since it basically assumes none of the files are binary.

Jump to

Keyboard shortcuts

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