Functions | |
endif | if (nargin< 2) directory |
endif | elseif (iscellstr(file)) files |
endfor | if (nargout > 0) filelist |
endif return else | error ("unpack: invalid input file class, %s", class(file)) |
if (isempty(commandlist)) commandlist.gz | |
if (isfield(commandlist, nodotext))[commandv | |
if (nargout > 0||needmove) command | |
endif else | warning ("unpack:filetype","unrecognised file type, %s", ext) |
if (isempty(s))[status | |
Variables | |
function | filelist |
endif if(ischar(file)) if(isdir(file)) if(isempty(filetype)) error("unpack | tmpfile = cstrcat (tmpnam (), ext) |
if(!success) error("unpack endif endif endif | cfile = urlwrite (urlfile, tmpfile) canonicalize_file_name (file) |
if(isempty(cfile)) error("unpack else | file = cfile |
for | i |
files = {files{:} tmpfiles{:}} | |
endif persistent | commandlist |
commandlist | z = commandlist.gz |
commandlist | bz2 |
commandlist | bz = commandlist.bz2 |
commandlist | tar |
commandlist | targz |
commandlist | tgz = commandlist.targz |
commandlist | tarbz2 |
commandlist | tarbz = commandlist.tarbz2 |
commandlist | tbz2 = commandlist.tarbz2 |
commandlist | tbz = commandlist.tarbz2 |
commandlist | zip |
endif | nodotext = ext(! ismember (ext, ".")) |
origdir = pwd () | |
commandq | |
parser | |
move = deal (commandlist.(nodotext){:}) | |
cstartdir = canonicalize_file_name (origdir) | |
cenddir = canonicalize_file_name (directory) | |
needmove = move && ! strcmp (cstartdir, cenddir) | |
else | command = commandq |
return | |
endif | s = stat (directory) |
msg = mkdir (directory) | |
endfor endfunction function | output |
if | ( | isempty(s) | ) |
if | ( | nargout | , | |
0|| | needmove | |||
) |
if | ( | isfield(commandlist, nodotext) | ) |
if | ( | isempty(commandlist) | ) |
endfor if | ( | nargout | , | |
0 | ||||
) |
endif if | ( | ) |
Initial value:
{"bzip2 -d -v \"%s\"", ... "bzip2 -d \"%s\"", ... @__parse_bzip2__, true}
if (! success) error ("unpack endif endif endif cfile = urlwrite (urlfile, tmpfile) canonicalize_file_name (file) |
endif persistent commandlist |
origdir = pwd () |
return |
Initial value:
{"tar xvf \"%s\"", ... "tar xf \"%s\"", ... @__parse_tar__, false}
Initial value:
{"bzip2 -d -c \"%s\" | tar xvf -", ... "bzip2 -d -c \"%s\" | tar xf -", ... @__parse_tar__, false}
Initial value:
{"gzip -d -c \"%s\" | tar xvf -", ... "gzip -d -c \"%s\" | tar xf -", ... @__parse_tar__, false}
endif if (ischar (file)) if (isdir (file)) if (isempty (filetype)) error ("unpack tmpfile = cstrcat (tmpnam (), ext) |
commandlist z = commandlist.gz |
Initial value:
{"unzip \"%s\"", ... "unzip -q \"%s\"", ... @__parse_zip__, false}