bugGNU Octave - Bugs: bug #38851, (MATLAB) 'W' specifier in fopen

 
 

bug #38851: (MATLAB) 'W' specifier in fopen

Submitter:  Guillaume <gyom>
Submitted:  Mon 29 Apr 2013 03:18:49 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  jwe
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 29 Apr 2013 06:34:36 PM UTC, comment #3: 
John W. Eaton <jwe>
Group administrator
Mon 29 Apr 2013 04:51:25 PM UTC, comment #2: 

Oops, I see the problem.  I'll fix it.

John W. Eaton <jwe>
Group administrator
Mon 29 Apr 2013 04:02:04 PM UTC, comment #1: 

I can confirm the warning message and error return value for both "W" and "R". The warning message sounds like it's doing the right thing, but the file is not opened.

A mode of "A" should also be treated like "a" for compatibility.

Mike Miller <mtmiller>
Group Member
Mon 29 Apr 2013 03:18:49 PM UTC, original submission:  

Following:
  http://undocumentedmatlab.com/blog/improving-fwrite-performance/
I tried to use specifier 'W+' instead of 'w+' in my ( MATLAB) code for fopen.
In Octave, a warning is displayed but the returned file identifier is -1:


octave> fp =fopen('file.dat','W+')
warning: fopen: treating mode "W" as equivalent to "w"
fp = -1


while it opens a file ok when using 'w+':

octave> fp =fopen('file.dat','w+')
fp = 3


Guillaume <gyom>

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -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
    2013-04-29 jwe StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2013-04-29 jwe StatusConfirmed In Progress
        Assigned toNone jwe
    2013-04-29 mtmiller CategoryNone Interpreter
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code