Skip to content

Instantly share code, notes, and snippets.

@scivision
Last active June 29, 2023 13:56
Show Gist options
  • Save scivision/45ae4550b782b6d53c9342f7a376e559 to your computer and use it in GitHub Desktop.
Save scivision/45ae4550b782b6d53c9342f7a376e559 to your computer and use it in GitHub Desktop.
Matlab extract .zst Zstd compressed files
function extract_zstd(archive, out_dir)
% extract a zstd file "archive" to "out_dir"
arguments
archive (1,1) string {mustBeFile}
out_dir (1,1) string {mustBeFolder}
end
tar_arc = tempname;
ret = system("zstd -d " + archive + " -o " + tar_arc);
assert(ret == 0, "problem extracting %s", archive)
untar(tar_arc, out_dir)
delete(tar_arc)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment