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

Home » Public Forums » archive » Re: Problem with too many open files
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: Problem with too many open files [message #14503] Sun, 28 February 1999 00:00
R.Bauer is currently offline  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 Go to previous message
davidf is currently offline  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 Go to previous message
Richard G. French is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: read_tiff - simple question
Next Topic: Re: CMYK TIFF in IDL?

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

Current Time: Fri Oct 10 07:04:12 PDT 2025

Total time taken to generate the page: 0.00706 seconds