bugGNU Octave - Bugs: bug #55102, gunzip/bunzip2 error with cell...


bug #55102: gunzip/bunzip2 error with cell array of strings input

Submitted by:  Guillaume <gyom>
Submitted on:  Mon 26 Nov 2018 11:39:29 AM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 27 Nov 2018 08:15:30 PM UTC, comment #4: 

Fixed in this cset: https://hg.savannah.gnu.org/hgweb/octave/rev/b9d72a2dac8f.

Closing report.

Rik <rik5>
Project Administrator
Tue 27 Nov 2018 07:56:34 PM UTC, comment #3: 

Something like what you suggest is a possibility, but I get a failure when I run the BIST tests for gzip.

test gzip
***** test run_test_function (@test_large_file)
!!!!! test failed
ASSERT errors for:  assert (cond {i},expected {i},tol)

  Location  |  Observed  |  Expected  |  Reason
     []      /home/rik/wip/Projects_Mine/oct-e9Hq7p /tmp/oct-ySR8qM/oct-e9Hq7p   Strings don't match

Working on a solution now.

Rik <rik5>
Project Administrator
Tue 27 Nov 2018 10:34:11 AM UTC, comment #2: 

Thanks Rik; files get unpacked separately:

>> flist = gunzip ({'./atst/a.tar.gz', './btst/b.tar.gz'})

flist =

  1x2 cell array

    {'atst/a.tar'}    {'btst/b.tar'}

One option would be to remove lines:

  if (isempty (dir))
    dir = fileparts (gzfile);

in gunzip/bunzip2 and allow unpack to have input argument dir equal to [], in which case one output directory per file would be used in the subsequent for-loop.

Guillaume <gyom>
Mon 26 Nov 2018 10:37:31 PM UTC, comment #1: 

Confirmed.  Matlab can accept a cell array of strings, but gunzip/bunzip2 in Octave are not documented to accept an array.

Can you test where Matlab places the destination files?

Try this

mkdir atst
mv a.tar.gz atst
mkdir btst
mv b.tar.gz btst
>> flist = gunzip ({'./atst/a.tar.gz', './btst/b.tar.gz'})

The files a.tar.gz and b.tar.gz are attached.

I want to know whether it unpacks a.tar.gz and b.tar.gz in to the first directory in the list ('./atst') or whether each is unpacked separately.

(file #45533, file #45534)

Rik <rik5>
Project Administrator
Mon 26 Nov 2018 11:39:29 AM UTC, original submission:  

If gunzip/bunzip2 is called with a single argument consisting of a cell array of strings, an error occurs when determining the output directory:

>> f = gunzip ({"a/a.txt.gz", "b/b.txt.gz"})
error: fileparts: FILENAME must be a single string
error: called from
    fileparts at line 35 column 5
    gunzip at line 43 column 9

When an output directory is not specified, the output files should be written to the same directory as the input files (which can vary from file to file).

Guillaume <gyom>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #45533:  a.tar.gz added by rik5 (157B - application/gzip)
file #45534:  b.tar.gz added by rik5 (182B - application/gzip)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by gyom (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-27 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2018-11-26 rik5 Attached File- => Added a.tar.gz, #45533
        Attached File- => Added b.tar.gz, #45534
        Item GroupUnexpected Error => Matlab Compatibility
        StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.5