[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Curious FindFile behavior
- Subject: Re: Curious FindFile behavior
- From: mallors(at)msfc.nasa.gov (Robert S. Mallozzi)
- Date: 26 Nov 1998 20:00:04 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: http://www.msfc.nasa.gov/
- References: <73holl$fts@milo.mcs.anl.gov>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:12979
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~