Code Monkey home page Code Monkey logo

tar-demux's Introduction

tar-demux

A native Go CLI tool for extracting files from an interlaced tar file (regular or STDIN).

The TAR file format allows for entries with duplicate file names. Most implementations will either complain during extraction or overwrite earlier extracted versions with latter versions.

I think allowing duplicate named entries makes tar feel more like a chunked file or stream multiplexor. In thinking about tar streams this way you can use allingeek/tar-merge-stream as a tar mux and this project as a tar demux.

Notes

  1. tar-demux appends file chunks in the order they are encountered in the archive.
  2. tar-demux will append contents of the archive to existing files on disk.
  3. tar-demux writes nothing to STDOUT (terminates a pipeline).

Todos

  1. There is some work to be done to make sure that files written do not escape the currnet working directory.
  2. Make sure that files appended to are regular files.

Examples

cat 1.txt
# first file.
tar tf input.tar
# 1.txt
# 2.txt
tar-mux <(cat input.tar) <input.tar > double.tar
tar tf double.tar
# 1.txt
# 2.txt
# 1.txt
# 2.txt
tar-demux < double.tar
ls
# 1.txt 2.txt
cat 1.txt
# first file.first file.

Authors and Copyright Holders

  1. Jeff Nickoloff "[email protected]"

License

This project is released under the MIT license.

tar-demux's People

Contributors

allingeek avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.