Navigation

Operators and Keywords

Function List:

C++ API

unpack.m File Reference


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

Function Documentation

endif elseif ( iscellstr(file  ) 

endif return else error ( "unpack: invalid input file   class,
%s"  ,
class(file  
)

if ( isempty(s)   ) 

if ( nargout  ,
0||  needmove 
)

if ( isfield(commandlist, nodotext  ) 

if ( isempty(commandlist  ) 

endfor if ( nargout  ,
 
)

endif if (  ) 

endif else warning ( "unpack:filetype"  ,
"unrecognised file   type,
%s"  ,
ext   
)


Variable Documentation

Initial value:

 {"bzip2 -d -v \"%s\"", ...
                       "bzip2 -d \"%s\"", ...
                       @__parse_bzip2__, true}

cenddir = canonicalize_file_name (directory)

if (! success) error ("unpack endif endif endif cfile = urlwrite (urlfile, tmpfile) canonicalize_file_name (file)

endif persistent commandlist

cstartdir = canonicalize_file_name (origdir)

if (isempty (cfile)) error ("unpack else file = cfile

Initial value:

 unpack (file, directory, filetype)

  if (nargin < 1 || nargin > 3)
    print_usage ()

endif endif files = {files{:} tmpfiles{:}}

for i

Initial value:

 1:numel (file)
      tmpfiles = unpack (file{i}, directory)

move = deal (commandlist.(nodotext){:})

msg = mkdir (directory)

needmove = move && ! strcmp (cstartdir, cenddir)

endif nodotext = ext(! ismember (ext, "."))

origdir = pwd ()

Initial value:

 __parse_tar__ (output)

endfunction

function files = __parse_gzip__ (output)



  files = {}

return

endif s = stat (directory)

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}