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

 
 

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

Submitter:  Guillaume <gyom>
Submitted:  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
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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);
  endif


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
matlab
>> 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>
Group 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:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group 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 or Warning Matlab Compatibility
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code