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: Sat, 22 Feb 2003 13:31:02 -0600

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

| I was about to submit a different patch for
| my previous post, but John beat me to it!
| 
| My problem now is that load(), only looks in the current
| directory (unlink Matlab, which searches the LOADPATH).
| 
| I recommend the following patch to fix this:
| 
| *** src/load-save.cc    Sat Feb 22 13:31:12 2003
| --- src/load-save.cc.orig       Sat Feb 22 11:39:30 2003
| ***************
| *** 3352,3358 ****
|       }
|     else
|       {
| !       std::string fname = file_ops::tilde_expand (file_in_path(argv[i],""));
| 
|         if (format == LS_UNKNOWN)
|         format = get_file_format (fname, orig_fname);
| --- 3352,3358 ----
|       }
|     else
|       {
| !       std::string fname = file_ops::tilde_expand (argv[i]);
| 
|         if (format == LS_UNKNOWN)
|         format = get_file_format (fname, orig_fname);

I think we should only do this for .mat files, and then only because
it is a compatible thing to do, not because it is necessarily a good
idea.  The problem (as I see it) is that it can produce unexpected
results depending on what old junk files happen to be scattered around
the load path.  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?

BTW, when you make diffs, please use

  diff -c old-file new-file

so the sequence of changes is old followed by new, additions are
marked with "+" and deletions are marked with "-".  It makes them much
easy to read.

Thanks,

jwe



reply via email to

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