[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File found by searching load path

From: Carnë Draug
Subject: Re: File found by searching load path
Date: Mon, 10 Dec 2018 15:11:43 +0000

On Fri, 7 Dec 2018 at 19:29, Rik <address@hidden> wrote:
> There is a new bug report #55173 which which shows, possibly, an irrelevant
> warning.
> octave:1> load penny.mat
> warning: load: '/usr/local/share/octave/5.0.0/data/penny.mat' found by
> searching load path
> I can see two approaches.  First, this warning has an ID,
> Octave:data-file-in-path, and we could change the default on Octave startup
> to disable this warning.  At that point, a user would have to actively turn
> on this warning to see it.
> Alternatively, I'm not sure why it is useful to know that the data file was
> found in the load path.  We could just remove the code entirely.
> Any votes one way or the other?

There's a third option.  There could be a variable that specifies the
data directory for Octave.  So someone could use:

    load (fullfile (OCTAVE_DATA_DIR, "penny.mat"));

And be explicit about what they want.  But since this is really only
for Octave's data, maybe a function instead?  Something like this:

    load_octave_data ("penny.mat");
    load_demo_data ("penny.mat");

The warning seems fine to me.  Searching the path for a file with the
same name and ignoring file extension is the type of feature that I
think we only support for Matlab compatibility.  But it's so crazy
that a warning against such terrible practice is justified.

The issue is that there's no way to load data files distributed with
Octave without triggering the warning (or without going through the
private __octave_config_info__).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]