Re: Problem with too many open files [message #14503] |
Sun, 28 February 1999 00:00 |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Phil Fischer wrote:
> I have a loop that has, among other things, the following commands:
>
> openw,1,command_file
> .
> .
> .
> close,1
>
> This loop will run for quite a large number of iterations and then will give me
> the following error message:
>
> % OPENW: Error opening file: /sdss3/usrdevel/philf/bin/commands.txt.
> Too many open files
>
> I have tried using free_lun but it doesn't seem to help.
>
free_lun is used to free get_lun unit numbers. You can use close ,/all.
R.Bauer
|
|
|
Re: Problem with too many open files [message #14508 is a reply to message #14503] |
Sat, 27 February 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Phil Fischer (philf@astro.lsa.umich.edu) writes:
> I have a loop that has, among other things, the following commands:
>
> openw,1,command_file
> .
> close,1
>
> This loop will run for quite a large number of iterations and then will give me
> the following error message:
>
> % OPENW: Error opening file: /sdss3/usrdevel/philf/bin/commands.txt.
> Too many open files
>
> I have tried using free_lun but it doesn't seem to help.
This sounds like a bug, and I seem to remember something like
this in an earlier version of IDL. Which version are you using?
> Any suggestions?
Well, hard-coding the logical unit number in a program like
you are doing is...how should I put it...suspect programming
practice at best. :-)
Does something like this work any better?
OpenW, lun, command_file, /Get_Lun
...
Free_Lun, lun
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Note: This follow-up was e-mailed to the cited author.]
|
|
|
Re: Problem with too many open files [message #14510 is a reply to message #14508] |
Sat, 27 February 1999 00:00  |
Richard G. French
Messages: 65 Registered: June 1997
|
Member |
|
|
Phil Fischer wrote:
>
> I have a loop that has, among other things, the following commands:
>
> openw,1,command_file
> .
> .
> .
> close,1
>
> This loop will run for quite a large number of iterations and then will give me
> the following error message:
>
> % OPENW: Error opening file: /sdss3/usrdevel/philf/bin/commands.txt.
> Too many open files
>
> I have tried using free_lun but it doesn't seem to help.
>
Try putting
HELP,/FILES
in there somewhere to see what files it thinks are open.
This openw,1 command may be a red herring, if there are other
things in the loop
Dick French
|
|
|