This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

"Too many open files" problem

Old posts that have not been replied to for several years.
Locked
K
Kripton
Voice
Posts: 28
Joined: Tue Jan 06, 2004 6:54 am

"Too many open files" problem

Post by Kripton »

Ok, my bot has several scripts working with files and several ones working with sockets.
After a while (10-48 hours) it always gives me the message "too many open files". I can't find the script causing this error, that's why I'm asking:

How can I see the "opened files" or the number, how many files the bot has opened

and:

Can I increase this number and would this help me (my bot)?

thx
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

'file channels' will give you a list of the currently open file channels. Increasing the max ammount would require you to recompile tcl (iirc), but it won't solve your problem. Make sure all your scripts 'close' file channels when they're done with them and everything should be fine :)
Have you ever read "The Manual"?
K
Kripton
Voice
Posts: 28
Joined: Tue Jan 06, 2004 6:54 am

Post by Kripton »

Ok, "file channels" gives me a very huge list!
But I can't see the script associated with the channel!

I really searched ALL my scripts for "open"s and "close"s and the number was equal and every "open" had its own "close"-command. But I still have an increasing number of file channels
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

You also have to make sure that the files are closed. If there's a return statement before the close, like inside an if or a loop, the file won't be closed. Same goes with sockets, which can be more problematic because they may be asynchronous, so tracking down the closing bit and making sure it's actually executed is harder.
Locked