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

Home » Public Forums » archive » Re: findfile on unix bug - help
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: findfile on unix bug - help [message #26924] Thu, 04 October 2001 13:48 Go to next message
R.G.S. is currently offline  R.G.S.
Messages: 46
Registered: September 2000
Member
Steve Smith<steven_smith> <nobody@nowhere.com> wrote in message
news:slrn9rpi8q.v7j.nobody@pooh.nrel.gov...
> On Thu, 4 Oct 2001 13:43:43 -0600, R.G.S. <rgs1967@hotmail.com> wrote:
>> Hi,
>>
>>
>>
>> I have a problem running my code on a unix machine
>> (idlv5.4). The command is as follows:
>>
>>
>> files = findfile(subdirectory+'*.dat',count=num)
>
> On Linux and IDL 5.2, I do: result=findfile('subdirectory/*.dat') and it
> works fine, what's the "+" for anyways?


subdirectory is a string retrieved through an object method.

My variable is
subdirectory = '/data/ocean03/QSCAT-KU2001/DATA/'
Thus, subdirectory+'*.dat' = '/data/ocean03/QSCAT-KU2001/DATA/*.dat'
and then
files = findfile('/data/ocean03/QSCAT-KU2001/DATA/*.dat',count=num)
doesn't work (gives file list from current directory)
whereas
files = findfile('/data/ocean03/QSCAT-KU2001/DATA/*',count=num)
does give all the files (problem is that I only want *.dat files).



There are ~11,000 files in that folder. This isn't (?) a problem since the
command works with the file name part = '*' as opposed to '*.dat'.

Cheers,
bob
Re: findfile on unix bug - help [message #26925 is a reply to message #26924] Thu, 04 October 2001 13:39 Go to previous messageGo to next message
nobody@nowhere.com (S is currently offline  nobody@nowhere.com (S
Messages: 55
Registered: July 2001
Member
On Thu, 4 Oct 2001 13:43:43 -0600, R.G.S. <rgs1967@hotmail.com> wrote:
> Hi,
>
>
>
> I have a problem running my code on a unix machine
> (idlv5.4). The command is as follows:
>
>
> files = findfile(subdirectory+'*.dat',count=num)

On Linux and IDL 5.2, I do: result=findfile('subdirectory/*.dat') and it
works fine, what's the "+" for anyways?

-Steve

>
> This does not give me the files in that subdirectory, rather it gives me the
> files in the current folder.
>
>
>
> So now if I do the same command as:
> files = findfile(subdirectory+'*',count=num)
> I do get the entire listing. This is how I work around it,
> however, it is possible that there are files other than the *.dat
> and I want to filter on those. This works in win2000 nicely, so
> what is the problem on the unix side?
>
> I can use * in unix command lines. For instance
>> ls *.txt
> lists only the txt files.
>
> So how do I perform this command so as to find and filter
> the *.dat files?
>
>
> Cheers,
> bob stockwell
> colorado research associates
> boulder co usa
>
>
> -- didn't find anything helpful on google groups
>
>
>


--
Steve S.

steve@NOSPAMmailaps.org
remove NOSPAM before replying
Re: findfile on unix bug - help [message #27072 is a reply to message #26924] Thu, 04 October 2001 14:40 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
"R.G.S." <rgs1967@hotmail.com> writes:

(stuff deleted)

> There are ~11,000 files in that folder. This isn't (?) a problem since the
> command works with the file name part = '*' as opposed to '*.dat'.

Actually, this leads me to believe that you might indeed be running into a
problem with the total number of files. The find_file.pro procedure I posted
earlier might help you.

The core of that routine is using spawn,/noshell. You might be able to do the
same thing with a command like

spawn,/noshell,['find',subdirectory,'-name','*.dat','-print' ],files

William Thompson

P.S. I still suggest first verifying that subdirectory isn't blank.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: the precision of PRINT and HELP statements
Next Topic: Re: Polygon filling oddities

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

Current Time: Wed Oct 08 16:51:40 PDT 2025

Total time taken to generate the page: 0.00378 seconds