annotate scripts/miscellaneous/bunzip2.m @ 6599:08ca72d6ffc9

[project @ 2007-04-28 22:47:29 by jwe]
author jwe
date Sat, 28 Apr 2007 22:47:29 +0000
parents 7fad1fad19e1
children 93c65f2a5668
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 -*-
6248
7fad1fad19e1 [project @ 2007-01-22 17:28:17 by jwe]
jwe
parents: 6082
diff changeset
21 ## @deftypefn {Function File} {} bunzip2 (@var{bzfile}, @var{dir})
6082
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
22 ## Unpack the bzip2 archive @var{bzfile} 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.
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
24 ## @seealso{unpack, bzip2, tar, untar, gzip, gunzip, zip, unzip}
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
25 ## @end deftypefn
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
26
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
27 ## Author: Bill Denney <denney@seas.upenn.edu>
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 function varargout = bunzip2 (files, outputdir)
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 if (! (nargin == 1 || nargin == 2))
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
32 print_usage ();
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
33 endif
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
34
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
35 if (nargin == 1)
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
36 outputdir = ".";
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
37 endif
6599
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
38
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
39 if (nargout > 0)
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
40 varargout = cell (1, nargout);
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
41 [varargout{:}] = unpack (files, outputdir, mfilename ());
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
42 else
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
43 unpack (files, outputdir, mfilename ());
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
44 endif
6082
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
45
588721ac2140 [project @ 2006-10-25 03:46:17 by jwe]
jwe
parents:
diff changeset
46 endfunction