Extracting zstd archive with tar

Zstd is a faster file archiving standard that is widely used as a better compressing replacement for .zip, gzip, etc. We have created interfaces for Matlab to extract .zst files. While ideally one would be able to extract .zst directly with tar --use-compress-program=zstd -xf myfile.zst, this doesn’t work on older tar like Windows includes from the factory.

zstd: error 25 : Write error : Broken pipe (cannot write compressed block) tar: Error opening archive: Child process exited with status 25

In this case, use a two-step process to extract the .zst file fully:

zstd -d myfile.zst   # creates tar file "myfile"
tar -xf myfile       # extract the original file/directory hierarchy