bugGNU Octave - Bugs: bug #43431, gzip does not handle directories...

 
 

bug #43431: gzip does not handle directories and files in different directories

Submitted by:  Rik <rik5>
Submitted on:  Fri 17 Oct 2014 05:42:28 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Sun 24 Jul 2016 01:33:52 PM UTC, comment #7:

This changeset also adds a bunch of new tests. Some of those tests are failing but it's an issue with bunzip2 and gunzip that were already present, just not reported and without tests. This new tests only bring them up but the failures themselves are not caused by this change:

http://hg.savannah.gnu.org/hgweb/octave/rev/766f934db568#l3.642

http://hg.savannah.gnu.org/hgweb/octave/rev/766f934db568#l3.674

I have them already reported as:

  • bug #48597 bunzip2 and gunzip remove original files
  • bug #48598 bunzip2 and gunzip do not actually output filenames
Carnë Draug <carandraug>
Project Member
Sat 23 Jul 2016 11:01:18 PM UTC, comment #6:

I'm seeing three failures after this changeset:

John W. Eaton <jwe>
Project Administrator
Fri 22 Jul 2016 04:41:31 PM UTC, comment #5:

Pushed http://hg.savannah.gnu.org/hgweb/octave/rev/766f934db568 which also adds a bunch more tests.

Carnë Draug <carandraug>
Project Member
Thu 21 Jul 2016 06:00:03 PM UTC, comment #4:

This patch reimplements gzip and bzip2 in C++ making use of the zlib and bzip2 libraries instead of calls to the applications.

I have also added more tests.

(file #37978)

Carnë Draug <carandraug>
Project Member
Sun 19 Jun 2016 09:19:42 PM UTC, comment #3:

Part of the issues here are shared with bzip2. I wrote a C++ function that makes use of bzip2 library. Hopefully, implementing gzip will be as simple.

This function takes a source filepath and destination source path as arguments. The logic of how to behave with directories still needs to be decided.

(file #37527)

Carnë Draug <carandraug>
Project Member
Sun 19 Jun 2016 01:37:47 AM UTC, comment #2:

Here's a test that I wrote but I'm not pushing because it's failing and I'm not sure we can easily work around them using the system's gzip and bzip2. I have no idea what behaviour this things should have, but as they are, it's definetely wrong, and Matlab's behaviour is mad too.

Carnë Draug <carandraug>
Project Member
Sat 18 Jun 2016 11:49:14 PM UTC, comment #1:

gzip has a few other issues for Matlab compatibility which are kind of related. Honestly, I think Matlab's behaviours is buggy but we should decide what to do before "fixing" our implementation.

When FILES is a directory, we should transverse the directory to find all files, but in such case, all files that are found by transversing directories are moved to a single directory but I'm not sure which one yet:

All test with R2010b

Matlab, has another weird behaviour. Even when specifying normal files only, if they reside in different directories, they end up being moved around not sure where:

This is a series of weird behaviours, I'd argue bugs in Matlab. Still, what behaviour do we want gzip to have in Octave?

Carnë Draug <carandraug>
Project Member
Fri 17 Oct 2014 05:42:28 PM UTC, original submission:

Apparently this hasn't worked correctly for a very long time. I went backwards through versions to 3.2.4 and haven't found this to ever work.

The problem is in scripts/miscellaneous/private/__xzip__.m. I've added a note in the code:

The issue is the algorithm which moves files and directories to a temporary directory, compresses them in-place in the temp directory, and then moves them to the output directory. This is pretty inefficient as an algorithm, but that is a separate issue.

The problem is that files which are compressed from say "junk" to "junk.gz" are correctly moved. But the code attempts to create the same name for directories as for files--so "junkdir/" becomes "junkdir/.gz".

Rik <rik5>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #37978:  bug-43431-gzip-bzip2-reimplement.cset added by carandraug (35KiB - application/octet-stream)
file #37527:  xzip.cc added by carandraug (2KiB - text/x-c++src)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 24 Jul 2016 01:33:52 PM UTCcarandraugOpen/ClosedOpen=>Closed
    Sat 23 Jul 2016 11:01:18 PM UTCjweOpen/ClosedClosed=>Open
    Sat 23 Jul 2016 12:22:01 PM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 21 Jul 2016 06:00:03 PM UTCcarandraugAttached File-=>Added bug-43431-gzip-bzip2-reimplement.cset, #37978
    Sun 19 Jun 2016 09:19:42 PM UTCcarandraugAttached File-=>Added xzip.cc, #37527
    Sat 18 Jun 2016 11:49:14 PM UTCcarandraugSummarygzip does not compress directories=>gzip does not handle directories and files in different directories

    Back to the top


    Powered by Savane 3.1-cleanup1