Skip to content

tar

miscellaneous · scripts/miscellaneous/tar.m

: entries = tar (tarfile, files)
: entries = tar (tarfile, files, rootdir)

Create the archive tarfile from files using the system tar program.

files is a file or folder name, a wildcard pattern or a cellstr of those, relative to rootdir (default: the current folder). Folders are archived recursively. The compression follows the archive’s extension (.tgz and .tar.gz gzip, .tbz, .tbz2 and .tar.bz2 bzip2, .tar.xz xz); a name without any extension gets .tar appended. The optional output is a column cell of the member names.