<html lang="en"> <head> <title>File Archiving Utilities - GNU Octave</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Octave"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="System-Utilities.html#System-Utilities" title="System Utilities"> <link rel="prev" href="Filesystem-Utilities.html#Filesystem-Utilities" title="Filesystem Utilities"> <link rel="next" href="Networking-Utilities.html#Networking-Utilities" title="Networking Utilities"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="File-Archiving-Utilities"></a> <p> Next: <a rel="next" accesskey="n" href="Networking-Utilities.html#Networking-Utilities">Networking Utilities</a>, Previous: <a rel="previous" accesskey="p" href="Filesystem-Utilities.html#Filesystem-Utilities">Filesystem Utilities</a>, Up: <a rel="up" accesskey="u" href="System-Utilities.html#System-Utilities">System Utilities</a> <hr> </div> <h3 class="section">36.3 File Archiving Utilities</h3> <!-- bunzip2 scripts/miscellaneous/bunzip2.m --> <p><a name="doc_002dbunzip2"></a> <div class="defun"> — Function File: <b>bunzip2</b> (<var>bzfile</var>)<var><a name="index-bunzip2-3206"></a></var><br> — Function File: <b>bunzip2</b> (<var>bzfile, dir</var>)<var><a name="index-bunzip2-3207"></a></var><br> <blockquote><p>Unpack the bzip2 archive <var>bzfile</var> to the directory <var>dir</var>. If <var>dir</var> is not specified, it defaults to the current directory. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dbzip2.html#doc_002dbzip2">bzip2</a>, <a href="doc_002dunpack.html#doc_002dunpack">unpack</a>, <a href="doc_002dgunzip.html#doc_002dgunzip">gunzip</a>, <a href="doc_002dunzip.html#doc_002dunzip">unzip</a>, <a href="doc_002duntar.html#doc_002duntar">untar</a>. </p></blockquote></div> <!-- gzip scripts/miscellaneous/gzip.m --> <p><a name="doc_002dgzip"></a> <div class="defun"> — Function File: <var>entries</var> = <b>gzip</b> (<var>files</var>)<var><a name="index-gzip-3208"></a></var><br> — Function File: <var>entries</var> = <b>gzip</b> (<var>files, outdir</var>)<var><a name="index-gzip-3209"></a></var><br> <blockquote><p>Compress the list of files and/or directories specified in <var>files</var>. Each file is compressed separately and a new file with a '.gz' extension is created. The original files are not modified. Existing compressed files are silently overwritten. If <var>outdir</var> is defined the compressed files are placed in this directory. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dgunzip.html#doc_002dgunzip">gunzip</a>, <a href="doc_002dbzip2.html#doc_002dbzip2">bzip2</a>, <a href="doc_002dzip.html#doc_002dzip">zip</a>, <a href="doc_002dtar.html#doc_002dtar">tar</a>. </p></blockquote></div> <!-- gunzip scripts/miscellaneous/gunzip.m --> <p><a name="doc_002dgunzip"></a> <div class="defun"> — Function File: <b>gunzip</b> (<var>gzfile, dir</var>)<var><a name="index-gunzip-3210"></a></var><br> <blockquote><p>Unpack the gzip archive <var>gzfile</var> to the directory <var>dir</var>. If <var>dir</var> is not specified, it defaults to the current directory. If <var>gzfile</var> is a directory, all gzfiles in the directory will be recursively gunzipped. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dgzip.html#doc_002dgzip">gzip</a>, <a href="doc_002dunpack.html#doc_002dunpack">unpack</a>, <a href="doc_002dbunzip2.html#doc_002dbunzip2">bunzip2</a>, <a href="doc_002dunzip.html#doc_002dunzip">unzip</a>, <a href="doc_002duntar.html#doc_002duntar">untar</a>. </p></blockquote></div> <!-- tar scripts/miscellaneous/tar.m --> <p><a name="doc_002dtar"></a> <div class="defun"> — Function File: <var>entries</var> = <b>tar</b> (<var>tarfile, files</var>)<var><a name="index-tar-3211"></a></var><br> — Function File: <var>entries</var> = <b>tar</b> (<var>tarfile, files, root</var>)<var><a name="index-tar-3212"></a></var><br> <blockquote><p>Pack <var>files</var> <var>files</var> into the TAR archive <var>tarfile</var>. The list of files must be a string or a cell array of strings. <p>The optional argument <var>root</var> changes the relative path of <var>files</var> from the current directory. <p>If an output argument is requested the entries in the archive are returned in a cell array. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002duntar.html#doc_002duntar">untar</a>, <a href="doc_002dbzip2.html#doc_002dbzip2">bzip2</a>, <a href="doc_002dgzip.html#doc_002dgzip">gzip</a>, <a href="doc_002dzip.html#doc_002dzip">zip</a>. </p></blockquote></div> <!-- untar scripts/miscellaneous/untar.m --> <p><a name="doc_002duntar"></a> <div class="defun"> — Function File: <b>untar</b> (<var>tarfile</var>)<var><a name="index-untar-3213"></a></var><br> — Function File: <b>untar</b> (<var>tarfile, dir</var>)<var><a name="index-untar-3214"></a></var><br> <blockquote><p>Unpack the TAR archive <var>tarfile</var> to the directory <var>dir</var>. If <var>dir</var> is not specified, it defaults to the current directory. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dtar.html#doc_002dtar">tar</a>, <a href="doc_002dunpack.html#doc_002dunpack">unpack</a>, <a href="doc_002dbunzip2.html#doc_002dbunzip2">bunzip2</a>, <a href="doc_002dgunzip.html#doc_002dgunzip">gunzip</a>, <a href="doc_002dunzip.html#doc_002dunzip">unzip</a>. </p></blockquote></div> <!-- zip scripts/miscellaneous/zip.m --> <p><a name="doc_002dzip"></a> <div class="defun"> — Function File: <var>entries</var> = <b>zip</b> (<var>zipfile, files</var>)<var><a name="index-zip-3215"></a></var><br> — Function File: <var>entries</var> = <b>zip</b> (<var>zipfile, files, rootdir</var>)<var><a name="index-zip-3216"></a></var><br> <blockquote><p>Compress the list of files and/or directories specified in <var>files</var> into the archive <var>zipfile</var> in the same directory. If <var>rootdir</var> is defined the <var>files</var> are located relative to <var>rootdir</var> rather than the current directory. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dunzip.html#doc_002dunzip">unzip</a>, <a href="doc_002dbzip2.html#doc_002dbzip2">bzip2</a>, <a href="doc_002dgzip.html#doc_002dgzip">gzip</a>, <a href="doc_002dtar.html#doc_002dtar">tar</a>. </p></blockquote></div> <!-- unzip scripts/miscellaneous/unzip.m --> <p><a name="doc_002dunzip"></a> <div class="defun"> — Function File: <b>unzip</b> (<var>zipfile</var>)<var><a name="index-unzip-3217"></a></var><br> — Function File: <b>unzip</b> (<var>zipfile, dir</var>)<var><a name="index-unzip-3218"></a></var><br> <blockquote><p>Unpack the ZIP archive <var>zipfile</var> to the directory <var>dir</var>. If <var>dir</var> is not specified, it defaults to the current directory. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dzip.html#doc_002dzip">zip</a>, <a href="doc_002dunpack.html#doc_002dunpack">unpack</a>, <a href="doc_002dbunzip2.html#doc_002dbunzip2">bunzip2</a>, <a href="doc_002dgunzip.html#doc_002dgunzip">gunzip</a>, <a href="doc_002duntar.html#doc_002duntar">untar</a>. </p></blockquote></div> <!-- unpack scripts/miscellaneous/unpack.m --> <p><a name="doc_002dunpack"></a> <div class="defun"> — Function File: <var>files</var> = <b>unpack</b> (<var>file</var>)<var><a name="index-unpack-3219"></a></var><br> — Function File: <var>files</var> = <b>unpack</b> (<var>file, dir</var>)<var><a name="index-unpack-3220"></a></var><br> — Function File: <var>files</var> = <b>unpack</b> (<var>file, dir, filetype</var>)<var><a name="index-unpack-3221"></a></var><br> <blockquote><p>Unpack the archive <var>file</var> based on its extension to the directory <var>dir</var>. If <var>file</var> is a list of strings, then each file is unpacked individually. If <var>dir</var> is not specified, it defaults to the current directory. If a directory is in the file list, then the <var>filetype</var> must also be specified. <p>The optional return value is a list of <var>files</var> unpacked. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dbzip2.html#doc_002dbzip2">bzip2</a>, <a href="doc_002dgzip.html#doc_002dgzip">gzip</a>, <a href="doc_002dzip.html#doc_002dzip">zip</a>, <a href="doc_002dtar.html#doc_002dtar">tar</a>. </p></blockquote></div> <!-- bzip2 scripts/miscellaneous/bzip2.m --> <p><a name="doc_002dbzip2"></a> <div class="defun"> — Function File: <var>entries</var> = <b>bzip2</b> (<var>files</var>)<var><a name="index-bzip2-3222"></a></var><br> — Function File: <var>entries</var> = <b>bzip2</b> (<var>files, outdir</var>)<var><a name="index-bzip2-3223"></a></var><br> <blockquote><p>Compress the list of files specified in <var>files</var>. Each file is compressed separately and a new file with a '.bz2' extension is created. The original files are not modified. Existing compressed files are silently overwritten. If <var>outdir</var> is defined the compressed files are placed in this directory. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dbunzip2.html#doc_002dbunzip2">bunzip2</a>, <a href="doc_002dgzip.html#doc_002dgzip">gzip</a>, <a href="doc_002dzip.html#doc_002dzip">zip</a>, <a href="doc_002dtar.html#doc_002dtar">tar</a>. </p></blockquote></div> </body></html>