Skip to content

Commit b3fa50a

Browse files
committed
extract_zstd: more checks
1 parent 3141719 commit b3fa50a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

+gemini3d/+fileio/extract_zstd.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
function extract_zstd(archive, out_dir)
22
% extract a zstd file "archive" to "out_dir"
3+
% out_dir need not exist yet, but its parent must
4+
% we do this in two steps to be reliable with old tar versions
5+
% https://www.scivision.dev/tar-extract-zstd
36

4-
if ~isfile(archive)
5-
error("%s is not a file", archive)
7+
arguments
8+
archive (1,1) string
9+
out_dir (1,1) string
610
end
711

12+
archive = gemini3d.fileio.expanduser(archive);
13+
14+
assert(isfile(archive), "%s is not a file", archive)
15+
816
[ret, ~] = system("zstd -h");
917
if ret ~= 0
1018
if ismac

0 commit comments

Comments
 (0)