Navigation

Operators and Keywords

Function List:

C++ API

: filelist = gzip (files)
: filelist = gzip (files, dir)

Compress the list of files and directories specified in files.

files is a character array or cell array of strings. Shell wildcards in the filename such as ‘*’ or ‘?’ are accepted and expanded. Each file is compressed separately and a new file with a ".gz" extension is created. The original files are not modified, but existing compressed files will be silently overwritten. If a directory is specified then gzip recursively compresses all files in the directory.

If dir is defined the compressed files are placed in this directory, rather than the original directory where the uncompressed file resides. Note that this does not replicate a directory tree in dir which may lead to files overwriting each other if there are multiple files with the same name.

If dir does not exist it is created.

The optional output filelist is a list of the compressed files.

See also: gunzip, unpack, bzip2, zip, tar.

Package: octave