findfile not recognized [message #44807] |
Wed, 20 July 2005 09:52  |
amohraz
Messages: 6 Registered: July 2005
|
Junior Member |
|
|
I am using IDL version 5.6 for some image processing and particle
dynamics. We've been using a bunch of algorithms routinely and all of a
sudden our software has decided to not recognize the command findfile.
I am trying to read images from the same folder that I'm in, and this
has worked a million times before but all of a sudden won't work
anymore and just won't see the files. Does anyone know what's going on
and how I can fix this?
|
|
|
Re: findfile not recognized [message #44899 is a reply to message #44807] |
Fri, 22 July 2005 08:21  |
brodzik@nsidc.org
Messages: 7 Registered: July 2005
|
Junior Member |
|
|
Mark Hadfield wrote:
> Perhaps findfile fails because there are *too many* files in the
> directory. I vaguely recall references to problems such as this on this
> group. I am too lazy to Google the group to confirm this, but you could
> give it a try.
I've had problems like this, when wildcards are being expanded, and end
up overloading (I think) the shell buffer's limit. I've tested for it
by going out to the shell, and doing an ls on the pattern that the
findfile command
was returning 0 files for (wrong answer, of course, I had checked the
filenames very thoroughly ;-)). The ls returns this:
% ls /my/very/long/path/to/lots/of/files/????/*H
/bin/ls: Argument list too long.
btw, it has to do with the filename wildcards ("*H")--not the "/????/",
because
% ls /my/very/long/path/to/lots/of/files/????/
returns the very long list I expected (which are more than twice as
many as the
*H would have limited them to.) Somebody explained the difference to
me once, but I can't remember now. I suspect file_search handles
things differently in the case of shell "Argument list too long"
errors, because it works.
Yet another nudge in favor of changing all that code to file_search...
--Mary Jo Brodzik
|
|
|
Re: findfile not recognized [message #44920 is a reply to message #44807] |
Thu, 21 July 2005 07:55  |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
R.G. Stockwell wrote:
> <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'
You could use
filename = dialog_pickfile()
Then filename *must* be correct.
Benjamin
|
|
|
|
Re: findfile not recognized [message #44927 is a reply to message #44807] |
Thu, 21 July 2005 06:26  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
I am completely puzzled.....................
Haje
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message
news:dbmmdd$j7c$1@newsreader.mailgate.org...
> amohraz@gmail.com wrote:
>> The command I typed was:
>>
>> f=findfile('/group2/Ali2/071805/6535j2/*.tif',count=nf)
>>
>> and I also tried:
>>
>> f=findfile('/group2/Ali2/071805/6535j2/6535j20001.tif',count =nf)
>>
>> and I know there are a lot of tif files in this location, including
>> 6535j20001.tif
>>
>> Then, print, nf gives me 0.
>>
>> Is this not the correct command?
>
> Looks OK.
>
> As David suggests, are you *sure* you have the names right? Try copying
> the directory and file names out of IDL into your shell console and back
> again to make sure.
>
> Can you get findfile to work as you expect on *any* directory?
>
> Perhaps findfile fails because there are *too many* files in the
> directory. I vaguely recall references to problems such as this on this
> group. I am too lazy to Google the group to confirm this, but you could
> give it a try.
>
>
> --
> Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
> m.hadfield@niwa.co.nz
> National Institute for Water and Atmospheric Research (NIWA)
|
|
|
Re: findfile not recognized [message #44933 is a reply to message #44807] |
Wed, 20 July 2005 16:23  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
amohraz@gmail.com wrote:
> The command I typed was:
>
> f=findfile('/group2/Ali2/071805/6535j2/*.tif',count=nf)
>
> and I also tried:
>
> f=findfile('/group2/Ali2/071805/6535j2/6535j20001.tif',count =nf)
>
> and I know there are a lot of tif files in this location, including
> 6535j20001.tif
>
> Then, print, nf gives me 0.
>
> Is this not the correct command?
Looks OK.
As David suggests, are you *sure* you have the names right? Try copying
the directory and file names out of IDL into your shell console and back
again to make sure.
Can you get findfile to work as you expect on *any* directory?
Perhaps findfile fails because there are *too many* files in the
directory. I vaguely recall references to problems such as this on this
group. I am too lazy to Google the group to confirm this, but you could
give it a try.
--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|
|
Re: findfile not recognized [message #44935 is a reply to message #44807] |
Wed, 20 July 2005 15:54  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
amohraz@gmail.com writes:
> The command I typed was:
>
> f=findfile('/group2/Ali2/071805/6535j2/*.tif',count=nf)
>
> and I also tried:
>
> f=findfile('/group2/Ali2/071805/6535j2/6535j20001.tif',count =nf)
>
> and I know there are a lot of tif files in this location, including
> 6535j20001.tif
>
> Then, print, nf gives me 0.
>
> Is this not the correct command?
I would appear so. You're not confusing an L with a 1,
or something like that, I presume? I'm out of ideas. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: findfile not recognized [message #44936 is a reply to message #44807] |
Wed, 20 July 2005 15:33  |
amohraz
Messages: 6 Registered: July 2005
|
Junior Member |
|
|
The command I typed was:
f=findfile('/group2/Ali2/071805/6535j2/*.tif',count=nf)
and I also tried:
f=findfile('/group2/Ali2/071805/6535j2/6535j20001.tif',count =nf)
and I know there are a lot of tif files in this location, including
6535j20001.tif
Then, print, nf gives me 0.
Is this not the correct command?
Thanks,
Ali
|
|
|
Re: findfile not recognized [message #44937 is a reply to message #44807] |
Wed, 20 July 2005 15:12  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
amohraz@gmail.com writes:
> Thanks, David. But you mean you're not surprised as in IDL has a mind
> of its own, or you're not surprised because I'm making an obvious
> mistake?!
I'm not surprised that typing the command exactly
as it was given to you didn't work. I'm pretty sure
that command was, uh, pseudo code. :-)
Show us a path to a directory where you know a file
with a specific name resides. Then show us the FindFile
command you use to search for that file, and the results
of *that* search. That might give us some clues.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: findfile not recognized [message #44939 is a reply to message #44807] |
Wed, 20 July 2005 14:56  |
amohraz
Messages: 6 Registered: July 2005
|
Junior Member |
|
|
Thanks, David. But you mean you're not surprised as in IDL has a mind
of its own, or you're not surprised because I'm making an obvious
mistake?!
I'd appreciate any help or input you could give me.
Many thanks!
Ali
|
|
|
Re: findfile not recognized [message #44943 is a reply to message #44807] |
Wed, 20 July 2005 14:41  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
amohraz@gmail.com writes:
> When I type this command and hit return, it doesn't give me any
> messages at all. I then typed the following:
> result = findfile('c:\path\to\images\*.*', count=nf)
> and then
> print, nf
> it prints 0.
I'm not surprised. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|