bugGNU Octave - Bugs: bug #52644, fopen warning for 'capital modes'...

 
 

bug #52644: fopen warning for 'capital modes' could be replaced with just documentation

Submitted by:  kire pudsje <kpc>
Submitted on:  Mon 11 Dec 2017 11:20:18 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Missed Error or Warning
Status: FixedAssigned to: None
Originator Name: Kire PudsjeOpen/Closed: Closed
Release: 4.2.1Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 15 Dec 2017 08:52:43 PM UTC, comment #2:

I changed the documentation on the stable branch in this cset http://hg.savannah.gnu.org/hgweb/octave/rev/d400b09043dd. Because I didn't want to change behavior on the stable branch (wouldn't be stable if I did) I removed the warnings on the development branch which will eventually become version 4.4.0. See cset http://hg.savannah.gnu.org/hgweb/octave/rev/c23b9af6a664.

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Tue 12 Dec 2017 12:36:59 AM UTC, comment #1:

By default, Octave is not setting the stream parameter std::ios::unitbuf which means that streams should get the default which is buffered output. This should be a performance win.

I think it would be useful to have someone test whether 'W' or 'w' still make a difference in Matlab. It certainly looks like the distinction is still present given their documentation: http://www.mathworks.com/help/matlab/ref/fopen.html#inputarg_permission.

I think you're right that a note in the documentation about the deliberate incompatibility would be useful here.

One of the few places where I could see the automatic flushing being useful would be real-time control of an instrument or robot that is occurring through a file-based mechanism (including a pipe). In that case, rather than having to use fflush() after every command, it would make sense to just open the command channel with auto-flush.

Rik <rik5>
Project Administrator
Mon 11 Dec 2017 11:20:18 PM UTC, original submission:

I ported some old Matlab scripts, then came across this warning

The capital letters in the modes provided a huge improvement in write performance when working with Matlab by not flushing (I do not know about current Matlab versions). As can also be read on this site:
https://undocumentedmatlab.com/blog/improving-fwrite-performance
In the Octave source code there is also a remark about not knowing where the capital letter modes are for (file-io.cc:142).

This warning can IMHO be removed.
Actually, to be correct, a warning should have been placed at the lower case modes. But please do NOT do that.
On the other hand, a remark about the flushing/non-flushing difference between Matlab and Octave in the help-page could be helpful.

kire pudsje <kpc>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 15 Dec 2017 08:52:43 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Tue 12 Dec 2017 12:36:59 AM UTCrik5StatusNone=>Confirmed
      Summaryremove fopen warning for 'capital modes'=>fopen warning for 'capital modes' could be replaced with just documentation

    Back to the top


    Powered by Savane 3.1-cleanup1