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

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