help-octave
[Top][All Lists]
Advanced

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

Re: gunzip incompatible


From: dbateman
Subject: Re: gunzip incompatible
Date: Mon, 28 Jan 2008 13:01:51 -0800 (PST)



Thomas Weber-8 wrote:
> 
> On 28/01/08 13:45 -0500, John W. Eaton wrote:
>> On 28-Jan-2008, Mats Hedlund wrote:
>> 
>> | In matlab, this works for unzipping an ODF spreadsheet:
>> gunzip('file.ods').
>> | In octave, it does not, replying with 'unknown file format'.
>> | Any thoughts on this and ways to fix it?
>> 
>> Octave's gunzip function is just a .m file.  It ultimately calls
>> another function called unpack to do the work.  I think the problem is
>> that gunzip is leaving it up to unpack to determine which
>> uncompression utility to use, when it should probably be forcing it to
>> use gzip.  It would be great if someone could have a look at this
>> problem and propose a patch.  Similar changes would likely be
>> appropriate for the bunzip2, untar, and unzip functions.
> 
> Well, how do you determine the compressing algorithm if not by the
> extension (by the way, .odf can be extracted by unzip, not gunzip)?
> 
> "file" is highly system-dependant. I guess the only solution would be to
> try all commands on an unknown file type and check their return value -
> bah, that's ugly.
> 
>       Thomas
> __________________________
> 

I think john means that the gunzip, etc implicitly have the compression type
defined by the function name that is called, whereas as unpack is the
generic function that determines the compression type based on the file
extension. Therefore if we pass a file to gunzip it should  be assumed that
its in  gzip format regardless of any file extension. Should be a relatively
simple patch to implement.

D.
-- 
View this message in context: 
http://www.nabble.com/gunzip-incompatible-tp15142094p15145265.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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