octave-maintainers
[Top][All Lists]
Advanced

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

Re: Problem with load


From: John W. Eaton
Subject: Re: Problem with load
Date: Mon, 24 Mar 2003 22:21:52 +0100

On 22-Feb-2003, Andy Adler <address@hidden> wrote:

| On Sat, 22 Feb 2003, John W. Eaton wrote:
| > It seems to me that if you want to load a file, you
| > should probably be asking for exactly the file you want.  But maybe
| > other people feel differently?  If so, what are the reasons (other
| > than compatibility) that this feature is a good idea?
| 
| Here is my reason:
| 
| if exist('processed_data.mat')
|    load processed_data.mat
| else
|    processed_data = recalculate_from_raw_data();
| end
| 
| Right now exist() doesn't tell me where it is, so
| there is no way I can issue the load command.
| 
| The fixes are: 1) have a way to know where it is, or
| 2) have load pick it up automatically.
| Matlab compatibility pushes for #1.
| 
| On the other hand, this could be a switch to load.

Couldn't you use file_in_loadpath to find the file?  It returns an
empty matrix if it doesn't find the file you are looking for.  Also,
you can use the optional argument "all" to find all the files with the
given name.  In that case, you could also warn about possible problems
due to duplicates.

jwe



reply via email to

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