help-octave
[Top][All Lists]
Advanced

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

Re: matlab commands what and gcf


From: John W. Eaton
Subject: Re: matlab commands what and gcf
Date: Mon, 15 Sep 2003 09:40:31 -0500

On 15-Sep-2003, address@hidden <address@hidden> wrote:

| On 12 Sep 2003 at 16:25, Joerg Schreiber wrote:
| 
| > octave:42> what
| > error: `what' undefined near line 42 column 1
| 
| Simple what is easy to write.  ls *.m gives most of it.
| 
| 'what path' is more difficult since the file_in_loadpath function 
| does not return directories.  E.g., file_in_loadpath("general","all")
| returns the empty string.  The correct approach would be to see
| if there is something in the kpathsea library shipped with octave
| which lists all the directories in the load path and search that.

Octave maintains an internal variable called Vload_path_dir_path.
This is an object of type dir_path and has a method all_directories
that returns a string_vector object containing all the directories in
the loadpath.  This is not the same as just looking at the components
of LOADPATH and DEFAULT_LOADPATH because some elements of those
variables may end in // which implies recursive searching.

I don't think the functionality of dir_path::all_directories is
exposed to the scripting language level yet, but it would be easy to
write a function that would return all the directories in a cell
array.  Should a call to file_in_loadpath with no arguments do this,
or should we have a new function?

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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