MATLAB Function Reference Previous page   Next Page
untar

Extract contents of tar-file

Syntax

Description

untar(tarfilename) extracts the archived contents of tarfilename into the current directory.

tarfilename is a string specifying the name of the tar-file. tarfilename is gunzipped to a temporary directory and deleted if its extension ends in .tgz or .gz. If an extension is omitted, untar searches for tarfilename appended with .tgz, .tar.gz, or .tar until a file exists. tarfilename can include the directory name; otherwise, the file must be in the current directory or in a directory on the MATLAB path.

untar(tarfilename,outputdir) Uncompresses the archive tarfilename into the directory outputdir. outputdir is created if it does not exist.

filenames = untar(...) extracts the tar archive and returns the relative pathnames of the extracted files into the string cell array filenames.

[...] = untar(url, ...) extracts the tar archive from an Internet universal resource locator (URL). The URL must include the protocol type (e.g., 'http://' or 'ftp://'). The URL is downloaded to the temp directory and deleted.

Examples

Copy all .m files in the current directory to the directory backup:

Untar and list Cleve Moler's "Numerical Computing with MATLAB" examples to the output directory ncm:

See Also

gzip, gunzip, tar, unzip, zip


Previous page  unmkpp unwrap Next page

© 1994-2005 The MathWorks, Inc.