A native Go CLI tool for merging two tar file streams (STDIN and named pipe) and streaming the result to STDOUT
- tar-mux merges records from the input streams as each becomes available
- tar-mux will buffer at most one file from each input stream into memory at a time. This may change in the future to a bufferless implementation.
- tar-mux will merge archive entries with names that already exist in the archive - this is purposeful.
- tar-mux only writes the tarball to STDOUT. Error messages will be sent on STDERR.
Suppose you have a tar file that you'd like to merge into a tar stream.
# setup some files
echo first file > 1.txt
echo second file > 2.txt
tar cf input.tar 1.txt 2.txt
echo third file > 3.txt
tar cf piped.tar 3.txt
# merge the tars
tar-mux <(cat piped.tar) < input.tar > merged.tar
# build a pipeline
echo fourth file > 4.txt
tar cf piped2.tar 4.txt
cat input.tar | tar-mux <(cat piped.tar) | tar-mux <(cat piped2.tar) > pipelined.tar
- Jeff Nickoloff "jeff@allingeek.com"
This project is released under the MIT license.