annotate scripts/miscellaneous/gunzip.m @ 6082:588721ac2140

[project @ 2006-10-25 03:46:17 by jwe]
author jwe
date Wed, 25 Oct 2006 03:46:17 +0000
parents
children 7fad1fad19e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6082
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 2006 Bill Denney
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
2 ##
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
4 ##
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
7 ## the Free Software Foundation; either version 2, or (at your option)
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
8 ## any later version.
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
9 ##
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
14 ##
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, write to the Free
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
18 ## 02110-1301, USA.
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
19
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
20 ## -*- texinfo -*-
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
21 ## @deftypefn {Function File} gunzip (@var{gzfile}, @var{dir})
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
22 ## Unpack the gzip archive @var{gzfile} to the directory @var{dir}. If
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
23 ## @var{dir} is not specified, it defaults to the current directory. If
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
24 ## the @var{gzfile} is a directory, all files in the directory will be
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
25 ## recursively gunzipped.
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
26 ## @seealso{unpack, bzip2, bunzip2, tar, untar, gzip, gunzip, zip, unzip}
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
27 ## @end deftypefn
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
28
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
29 ## Author: Bill Denney <denney@seas.upenn.edu>
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
30
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
31 function varargout = gunzip (files, outputdir)
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
32
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
33 if (! (nargin == 1 || nargin == 2))
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
34 print_usage ();
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
35 endif
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
36
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
37 if (nargin == 1)
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
38 outputdir = ".";
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
39 endif
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
40 varargout = cell (1, nargout);
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
41 [varargout{:}] = unpack (files, outputdir, mfilename ());
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
42
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
43 endfunction