How can I separate multiple files from single file caused by zstd -r folder -o output.zst?

Tun

I didn't read enough the manual and run the following command

$ zstd -r folder -o output.zst

The following command gave me back a single file called output

$ unzstd output.zst 

The output file has all the contents of the files under the folder concatenated.

Is there some tools or programs to un-concatenate the single file into multiple original files?

This is the only backup file I have and I need the backup.

EDIT: what I really should have run (according to this thread) is

# for tar version 1.31 and above
$ tar --zstd -cf output.tar.zst folder

# for tar version < 1.31
$ tar --use-compress-program zstd -cf output.tar.zst folder
Tun

I also posted this question in zstd github issue and I learnt the following from Cyan4973.

all compressed frames are just stored back to back in the same file output.zst.

While there would be a way, at least in theory, to separate each frame, and therefore find the boundaries of each file, another problem is that none of these frames contain the file name, nor the position in directory tree. So you would end up with a bunch of nameless files.

The proper way to archive is to combine zstd with tar, which is in charge of preserving file metadata.

Currently there is no tools or programs to separate frames. But someone could write using lz4frame.h.

By default, the CLI will just decompress all frames back-to-back into the same decompressed file ...

... program it yourself, ... use the ZSTD_decompressStream() API.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to decompress lzma2 (.xz) and zstd (.zst) files into a folder using Python 3?

How can I process multiple dataframes and save the output in separate files using R?

How can I output UIAlertController to a separate file and output data from there?

How can I separate many files from one folder into separate folders based on the name of the files?

How can i split an Audio file into multiple audio wav files from folder

How can I print lines from a file to separate files

How can I merge multiple topojson files into single topojson file

How can I load multiple html files from a folder into a div

How can I copy files from a folder into multiple folders

How can I extract data from multiple files in a folder of excel

How can I decompress an archive file having tar.zst?

Why can't I read multiple HDF5 files from a folder? Meanwhile, I can read a single HDF5 file fine... (Python 3.7)

How can I compress every 10 files in a folder as a separate zip file?

Copy multiple files from multiple folders to a single folder using R

How can I run multiple expressions with single file in Shiny R?

How to convert read multiple text files from a folder and convert it into a single CSV file?

How can I export separate node and edge files from single cypher query?

How can I pair values together from one text file and output the result to a separate file using pandas?

How can I convert a folder of audio files into a single file (iterate over many folders)?

Can I grep for text in multiple files and output the results to a single .csv?

Webpack: How do I bundle multiple javascript files into a single output file?

Merging multiple data files into a single output then creating a file from this

How to generate multiple output files from single input file that does not share naming convention in snakemake?

How can I import from multiple files in r-drake?

How can I get the average for a column from multiple files in R?

How can I extract multiple tgz files into seperate folder which have part of file names?

How can I save terminale output from certain folder (ls command) to txt file? For Pycharm

How can I separate my typescript code into multiple files?

How can I access and read multiple XML format files within a folder using R?