|
From: | John W. Eaton |
Subject: | Re: File found by searching load path |
Date: | Mon, 10 Dec 2018 15:33:27 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 12/10/18 3:25 PM, Rik wrote:
I'd prefer not to have another function. If we know OCTAVE_DATA_DIR, couldn't we simply check whether the file we found was in that directory and skip producing a warning in that case? The code is in utils.cc. if (! local_file_ok) { load_path& lp = __get_load_path__ ("find_data_file_in_load_path"); // Not directly found; search load path. std::string tmp = sys::env::make_absolute (lp.find_file (fname)); if (! tmp.empty ()) { warn_data_file_in_path (fcn, tmp); fname = tmp; } } If the file is found through searching (! tmp.empty ()), add in another test that the directory is not the same as OCTAVE_DATA_DIR.
To me, the situation is no different if the file is found in OCTAVE_DATA_DIR or somewhere else. If I happen to have my own file penny.mat but am confused about what directory I'm in, I'd like that to be an error rather than silently loading Octave's penny.mat file.
It's fine with me if we disable the warning by default, but I'd like to keep it.
jwe
[Prev in Thread] | Current Thread | [Next in Thread] |