bugGNU Octave - Bugs: bug #47628, dlmread does not search loadpath...

 
 

bug #47628: dlmread does not search loadpath for files

Submitted by:  Nicholas Jankowski <nrjank>
Submitted on:  Tue 05 Apr 2016 08:18:14 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Nicholas JankowskiOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 06 Apr 2016 09:14:19 PM UTC, comment #5:

I checked in the following changeset on default:

http://hg.savannah.gnu.org/hgweb/octave/rev/fe5ed6d7fb10

John W. Eaton <jwe>
Project Administrator
Wed 06 Apr 2016 08:55:12 PM UTC, comment #4:

true, that would make code written for Octave run in both programs, but wouldn't solve the problem of code written for Matlab running error-free in Octave.

Nicholas Jankowski <nrjank>
Wed 06 Apr 2016 08:28:06 PM UTC, comment #3:

A Matlab compatible workaround is to use the which function when you want to open a data file for reading that is intended to be found on the function load path:

Mike Miller <mtmiller>
Project Administrator
Tue 05 Apr 2016 08:48:55 PM UTC, comment #2:

I actually like that it produces a warning. my issue is more that Octave errors out on the fileload for dlmread while fopen works, which seems a little odd.

Nicholas Jankowski <nrjank>
Tue 05 Apr 2016 08:41:12 PM UTC, comment #1:

Well, I regularly get warnings "file found in load path", so some functionality is there.

IIRC there is a somewhat older bug report about this warning (can't find it now).

Google turns up some explanation:
https://lists.gnu.org/archive/html/octave-maintainers/2008-03/msg00387.html
Answering there JWE mentions his reasoning for not wanting to follow Matlab. I tend to agree with that reasoning.

Philip Nienhuis <philipnienhuis>
Project Member
Tue 05 Apr 2016 08:18:14 PM UTC, original submission:

Tested on Windows 7 with Octave 4.0.1, checked against Matlab 2015b

There seems to be inconsistency with what files can be accessed after the folder has been added via addpath. Octave help says addpath adds a folder to the function search path. Functions are thus found and executed as expected. However, other files, such as a csv data file, are found by some functions and not others.

e.g., making a folder 'c:/temp/testdata', and adding a small csv text file mytestdata.csv containing:

the following works locally as expected:

But:

Checking in Matlab, the file opens just fine using dlmread. There is also no strict definition in the matlab help for addpath that the path is a 'function only' path, and that it shouldn't be able to find data files.

Seems there may be a case where Matlab m-code may expect to be able to create a folder, addpath, put data files in there, and access them without a cd to the folder, and that this could error out in Octave. Unclear as to whether this is considered 'undocumented matlab' that we'd be trying to correct for.

Nicholas Jankowski <nrjank>

 

(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 jwe (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by nrjank (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 06 Apr 2016 09:14:19 PM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release4.0.1=>dev
      Operating SystemMicrosoft Windows=>Any
      Summaryaddpath does not find data files for dlmread while matlab does=>dlmread does not search loadpath for files

    Back to the top


    Powered by Savane 3.1-cleanup1