bugGNU Octave - Bugs: bug #59225, "save -z -binary...


bug #59225: "save -z -binary -append" creates non readable files

Submitted by:  Carlo de Falco <cdf>
Submitted on:  Tue 06 Oct 2020 08:24:48 AM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  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 03 Nov 2020 06:37:10 PM UTC, comment #5: 

I pushed a changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/be883573bbcc) that emits an error if -append, -zip, and a binary format are used together.

Marking as ready for test.

Rik <rik5>
Project Administrator
Fri 30 Oct 2020 08:48:21 PM UTC, comment #4: 

I ran through the the set of all filetypes and I found that "-binary" and "-v6" both fail to append variables to a saved file when used in conjunction with "-zip" option.  Separately, saving with "-z -v7" does not result in a compressed file, which is perhaps why that format works.

The "-append" option is not very robust.  Would it be acceptable to limit it's use when "-zip" is also given only to text formats (-text or -ascii)?  That would just mean changing the save() function to do a bit more input validation and issue an error or a warning when the condition is found.

Rik <rik5>
Project Administrator
Thu 08 Oct 2020 03:12:20 PM UTC, comment #3: 

I'm changing the release to "dev".  This report was filed against the 6.0.90 release candidate, but I don't see any simple fix that can be made ahead of the release.  Hence, I think this needs to be resolved, if it can be, on the development branch.

Rik <rik5>
Project Administrator
Thu 08 Oct 2020 08:24:40 AM UTC, comment #2: 

This is probably obvious, but to be extremely clear,
the issue shows only with "-z -binary", "-binary" alone
works OK.

Carlo de Falco <cdf>
Project Member
Wed 07 Oct 2020 09:03:29 PM UTC, comment #1: 

Confirmed.  For reference, this works if the filetype is text rather than binary.  I also tried with '-v7' and it worked as well.  I didn't check every filetype, but it is probably the case that only -binary has a problem.

Rik <rik5>
Project Administrator
Tue 06 Oct 2020 08:24:48 AM UTC, original submission:  

I am not sure whether this is expected behaviour,
but I cannot seem to find mention of it in the docs :

>> a = randn (4);
>> b = randn (5);
>> save -binary prova a
>> save -binary -append prova b
>> clear all
>> load prova
>> whos
Variables visible from the current scope:

variables in scope: top scope

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  =====
        a           4x4                        128  double
        b           5x5                        200  double

Total is 41 elements using 328 bytes

>> save -z -binary provaz a
>> save -z -binary -append provaz b
>> clear all
>> load provaz
error: load: trouble reading binary file 'provaz'
>> __octave_config_info__ hg_id
ans = 2219027f5bd4+
>> version
ans = 6.0.91

Carlo de Falco <cdf>
Project Member


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cdf (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-12-04 rik5 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2020-11-03 rik5 StatusConfirmed => Ready For Test
    2020-10-08 rik5 Release6.0.90 => dev
    2020-10-07 rik5 StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.6