Re: findfile not recognized [message #44924 is a reply to message #44802] |
Thu, 21 July 2005 07:37   |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
<amohraz@gmail.com> wrote in message
news:1121882624.312760.62700@g14g2000cwa.googlegroups.com...
> Thanks a lot for your response, Haje. findfile just doesn't find
> anything, and I have tried specifying the full path. It doesn't work!
> Thanks for your suggestion on file_search. The problem is I'm using a
> lot of routines that were written by other people and frequently use
> findfile in them, so I would have to modify a lot of files if I were to
> change all of them to file_search.
> Do you have any ideas as to how to fix this?
> Many thanks again,
> Ali
A couple of suggestions:
your filename is almost certainly to blame.
0) use file_search. Seriously.
1) To be certain you have the correct path, try to read the tif file
filename = '/group2/Ali2/071805/6535j2/6535j20001.tif'
f=findfile(filename,count=nf)
help,f
Result = READ_TIFF( Filename)
help, result
f_search=file_search(filename)
help,f_search
2) are the files ending in tiff rather than tif?
3) is it a network drive and the access is too slow (so the command times
out?)
4) so if you can get the much better file_search() routine to work, perhaps
you could
overwrite the findfile routine (i don't remember ver 5.6, is findfile a
*.pro routine?)
Anyways, if you could write a findfile routine that just called file_search,
that may solve
the problem. Disclaimer, this would be a pretty bad hack, completely
non-portable,
and certain to cause great error and confusion in the future. Only soulless
demons
like myself would even consider the idea. You'd be much better off changing
every
call to findfile in all your source code.
5) do you have a HUGE number of files? That could be a problem. I ran into
a
real damaging bug reading satellite data files, because my findfile routines
would
return something like 98% of the files that actually existed, causing my
robust code
to handle the "missing data" when it was in fact not missing.
In one case, I had to actually cd to the path, and get the current listing
cd,cur=cur
cd,subdirectory
files = findfile('*.'+filetype,count=num)
cd,cur
That was an operating system problem, that went away with the next upgrade
(sorry I don't remember what version, it was a redhat linux of a couple
years ago).
Cheers,
bob
|
|
|