[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: decompress any compressed type

From: John W. Eaton
Subject: Re: decompress any compressed type
Date: Thu, 19 Oct 2006 13:43:06 -0400

On 17-Oct-2006, Bill Denney wrote:

| David Bateman wrote:
| > Bill Denney wrote:
| >   
| >> scripts/ChangeLog:
| >>
| >> 2006-10-17  Bill Denney  <address@hidden>
| >>    * miscellaneous/decompress.m: new function, decompress any file
| >> based on its extension
| >>     
| > This is a good idea. However, rather than throwing an error if the
| > extension is not recognized, can you set "files = file" and return.....
| >   
| Here is that version (also with a slightly better help description).

OK, I would accept this function but I have a few comments.

I'm not sure that decompress is the best name since I think of as just
the compress part, and this function also handles extracting files
from archives, not just uncompressing them.  Maybe we could call it
"unpack", though that could also be confusing given the meaning of
"pack" in Matlab.

|     switch lower(ext)
|       case {".gz" ".Z"}
|       files = gunzip (file, directory);

I don't think we have a gunzip (or gzip) function yet.

Now that we have urlwrite, we should be able to fix unzip and write
a version of gunzip to do things like

    url = "http://some.where.org/some-files.zip";;
    file_list = unzip (url, 'some-files')


  url = "http://www.octave.org/octave-2.1.73.tar.gz";;
  gunzip (url, "outputdir");

which is needed for Matlab compatibility.

Matlab also searches for files in the MATLABPATH, but I don't think it
is necessary for Octave to do this.

It would also be nice to have the bunzip2 function.  There would be
very few differences between gunzip and bunzip2, so they could
probably be based on a common core funtion.  Likewise for gzip and


reply via email to

[Prev in Thread] Current Thread [Next in Thread]