bugGNU Octave - Bugs: bug #37502, unrecgonised options to 'save' do...

 
 

bug #37502: unrecgonised options to 'save' do not raise an error

Submitted by:  Francesco Potortì <pot>
Submitted on:  Thu 04 Oct 2012 12:16:58 PM UTC  
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  3.6.2 Operating 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)

Tue 30 Oct 2012 03:22:27 PM UTC, comment #6: 

For compatibility I changed save to produce a warning for an unrecognized option.  If the saved file name really needs to begin with a '-' then a save followed by a rename is probably the easiest workaround.  The change was made on the development branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/e05eafe7105a).  To access the fix you will need to build from development sources or wait until the 3.8 stable release.

Rik <rik5>
Project Administrator
Thu 04 Oct 2012 02:16:02 PM UTC, comment #5: 

The only reason that matters is #3. #4 is false, there is no difference between the functional form and the command form. Every function can be called in command form. Command form is just syntactic sugar for passing strings to a function.

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Thu 04 Oct 2012 02:12:38 PM UTC, comment #4: 

1) because in probably 99% percent of cases you are just mistyping an option
2) because strings beginning with - should be interpreted as options by save
3) because Matlab does so
4) because you can use the functional form if you really want that

Francesco Potortì <pot>
Thu 04 Oct 2012 02:05:59 PM UTC, comment #3: 

Why should I be prevented from creating a file with a leading '-' in its name?

John W. Eaton <jwe>
Project Administrator
Thu 04 Oct 2012 01:58:23 PM UTC, comment #2: 

Yes, I see that such a file is created, in fact.
What a horrible behaviour!

One of my colleagues tried this on Matlab:

a=2; save -mat-zibibbo a a

and got an error about nonexisting option.

Francesco Potortì <pot>
Thu 04 Oct 2012 01:20:23 PM UTC, comment #1: 

The same is true for any unrecognised option, but it should save a file called "-mat-ascii". Can you verify that it does not save such a file? I see such a file.

Before we decide to error out on this, can you find someone who can verify that Matlab also errors out on unrecognised options?

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Thu 04 Oct 2012 12:16:58 PM UTC, original submission:  

According to save's docs, the 'mat-ascii' option does not exist. In fact, if used, save does nothing.

However, it should raise an error, which it does not.

This is 3.6.2 on Debian.

Francesco Potortì <pot>

 

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

Attach Files:
   
   
Comment:
   

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 jwe (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by pot (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-10-30 rik5 StatusNeed Info => Fixed
        Open/ClosedOpen => Closed
    2012-10-04 jordigh StatusNone => Need Info
    2012-10-04 jordigh Summary\'-mat-ascii\' option to \'save\' does not raise an error => unrecgonised options to 'save' do not raise an error

    Back to the top


    Powered by Savane 3.5