comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Curious FindFile behavior
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Curious FindFile behavior [message #13774 is a reply to message #13589] Thu, 26 November 1998 00:00 Go to previous messageGo to previous message
mallors is currently offline  mallors
Messages: 76
Registered: November 1997
Member
In article <73holl$fts@milo.mcs.anl.gov>,
lesht@ANLER.ER.ANL.GOV (Barry Lesht) writes:
> I'm running IDL5.1 on an SGI (IRIX6.2). I'm using FindFile to create
> an array of data filenames that I can pass to some processing code.
> There are (as it turns out) 515 files in the directory I'm searching.
> The filenames are all of the form xxxxxxxxx.xx.yymmdd.hhmmss.cdf. I
> get the following from FindFile-
>
> IDL> files=FindFile('*.*', COUNT=nf)
> IDL> PRINT, nf
> 0
> IDL> files=FindFile('*.cdf', COUNT=nf)
> IDL> PRINT, nf
> 0
> IDL> files=FindFile('*98*.cdf', COUNT=nf)
> IDL> PRINT, nf
> 0
> IDL> files=FindFile('*980*.cdf', COUNT=nf)
> IDL> PRINT, nf
> 425
> IDL> files=FindFile('*981*.cdf', COUNT=nf)
> IDL> PRINT, nf
> 90
>
> I don't see why cases 2 and (especially) 3 didn't result in nf=515.
> Can anyone explain this? Thanks.

This problem should really be addressed by RSI. What is
happening, I believe, is that FINDFILE is spawning a shell to
get the file list via something like "ls". However, the shell
has limits on the byte length of command line arguments - for
long lists, the command will fail. RSI should really be
using another UNIX tool meant for this job - that is the
"find" command. See the UNIX man pages exec(2), find(1),
xargs(1) for more info.

I have a program FINDFILES on my web page that should work
for you, and also "fixes" searching for files recursively.
See http://cspar.uah.edu/~mallozzir/idl/idl.html



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code ES 84
Work: http://www.batse.msfc.nasa.gov/ Marshall Space Flight Center
Play: http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: vector plots and map backgrounds
Next Topic: Masking of land/sea

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 03:34:37 PDT 2025

Total time taken to generate the page: 1.12778 seconds