octave-maintainers
[Top][All Lists]
Advanced

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

changes to path searching


From: John W. Eaton
Subject: changes to path searching
Date: Thu, 26 Dec 2002 23:35:45 -0600

I've just checked in some changes that make Octave's path searching
behave more like Matlab.  Instead of searching for the entire
directory tree for .oct files, then searching again for .m files,
Octave now searches for .oct or .m files (in that order) in each
directory in the path.  This means that you can now create a .m file
that overrides a .oct file, provided that the .m file is located in a
directory that appears in the LOADPATH before the directory containing
the .oct file.  Previously, the .oct file would always be found
because Octave would search first for .oct files, then .m files.

You can also use file_in_loadpath to perform the same kind of search
with a command like

  file_in_loadpath ({"foo.oct", "foo.m"})

to search each directory in the loadpath for foo.oct then foo.m, and
return the first one found, or

  file_in_loadpath ({"foo.oct", "foo.m"}, "all")

if you want to find the locations of all the files, in the order
they are found.

The down side of this change is that it required changes to the
internals of the kpathsearch library.  I've submitted a patch to the
kpathsearch maintainers, but I don't know whether they will accept it.
So it may be a bit longer until we can use a "standard" version of
kpathsearch with Octave.

Comments?

jwe



reply via email to

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