Zstd: Files only, not directories?

Created on 8 Sep 2016  ·  3Comments  ·  Source: facebook/zstd

I am a bit curious when looking at the examples. There are options to zip up multiple files, but when supplying a directory, it simply skip that. Is it possible to add directory support in future generations, or we need to do it with tar cf x/ | zstd > x.tar.zst or tar -I zstd -cf x.tar.zst x?

question

Most helpful comment

zstd can compress multiple files, but it will compress them individually. If you want to compress an archive, first create an uncompressed tar or zip archive, and then compress the archive with zstd.

zstd is just a compressor, and doesn't have a format for creating an archive from multiple files. libarchive is a library that will create compressed archives, and it has zstd support.

All 3 comments

zstd has the same scope as compress/gzip/bzip2, so it is not an archiver.

You can compress multiple files in a directory : zstd -r directory. It will result in one compressed file _for each source file_.

But that's not the same as converting a directory content into a single archive.
For this task, tar is needed.

@Cyan4973 perhaps give zstd the capability to load a list containing the files names.

zstd can compress multiple files, but it will compress them individually. If you want to compress an archive, first create an uncompressed tar or zip archive, and then compress the archive with zstd.

zstd is just a compressor, and doesn't have a format for creating an archive from multiple files. libarchive is a library that will create compressed archives, and it has zstd support.

Was this page helpful?
0 / 5 - 0 ratings