Re: Who's up for breaking IDL? [message #36008 is a reply to message #35824] |
Mon, 04 August 2003 09:00   |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
"Craig Markwardt" <craigmnet@cow.physics.wisc.edu> wrote in message
news:onk79tph3q.fsf@cow.physics.wisc.edu...
>
> "R.G. Stockwell" <noemail@please.com> writes:
>> Yeah, it'd be a pain. What I'd do if I was IDL is strupcase all the
>> filenames from
>> the OS then search, and report an error if you ended up with more than
one
>> filename.
>> You would have to do something like to maintain platform independence.
>
> You are making an assumption of how the IDL path searching ability
> works. It is quite possible that it does *not* work by retrieving
> "all the filenames" from the path. Also, your proposal would require
> IDL to have within it, filename comparison code, which presumably is
> exactly what the OS does well, not client programs.
Yes, you are right. IDL does not store names, only paths. IDL does
build up a cache though. According to the help
"After trying to open the file in the user's current working
directory, IDL will attempt to open the file in each of the
directories given by the !PATH system variable, in the
order specified by !PATH. The search stops with the
first directory containing a file with the desired name.
IDL now maintains an in-memory cache of the .pro and .sav files
located in directories referenced via the !PATH system variable.
This path cache is built automatically during normal operation, as
IDL searches the directories specified by !PATH to locate the
code for IDL routines required at runtime. "
Having read this, I don't see why the IDL code of the OP does not work.
It should try to open the file given in the filename string, and that fact
that
it fails (for the Resolve_Me.pro example) means that somewhere IDL
has changed that string. Sounds like a bug.
Windows is
> distinct in that it *stores* file names with case sensitivity, but
> *compares* them without case sensitivity. Unix perserves case for
> both storage and comparison.
>
>> Or, just search for the name with the case given in IDL, I don't see why
>> that
>> would make any difference.
>
> The IDL language disregards all upper and lower cases. The IDL
> astronomy library uses a lot of UPPER CASE, but I use "lower case,"
> and then there are people who use MixedCase. It would be pretty much
> unacceptable at this date to change the requirement on case
> sensitivity for IDL programs.
I concur, certainly for all idl code. However, I think literal string, or
string
values should be case sensitive (and they are). So in the original posters
code, the
IDL> resolve_routine, 'Resolve_Me'
% Attempt to call undefined procedure/function: 'RESOLVE_ME'.
% Execution halted at: $MAIN$
should have worked, since it should have tried to open the correct file.
Of couse, this leads to the problem of having two differently cased
filenames in
the same folder, but I don't think that problem is any different that having
two
files of the same name in different folders. That is just a programers
error
if the programmer lets it happen.
Cheers,
bob
|
|
|