Hi all: thanks for the responses.

I should have done this in the beginning. I checked the status open returns. I 
try to open 388 files, but it returned true(1) only 249 times (for the first 
249 opens). So I guess thats the limit.

Also to make sure I am doing the right way, the following is how I am opening 
the files
$AgentFH{$id} = *$name;
open($AgentFH{$id}, ">>$filename");

I am speaking to the system admin if he can bump up the limit to 1024.

Any other thoughts? 
TIA
Ravi

----- Original Message ----
From: Tom Phoenix <[EMAIL PROTECTED]>
To: Ravi Malghan <[EMAIL PROTECTED]>
Cc: beginners@perl.org
Sent: Saturday, December 2, 2006 10:54:05 AM
Subject: Re: Limit of number of files that can be opened in perl


On 12/1/06, Ravi Malghan <[EMAIL PROTECTED]> wrote:

> Hi: is there a limit on number of files that can be open within perl.

Some systems use ulimit to put an upper limit on the number of open
files. And I believe that at least some perl releases have an overall
limit of 128 files at once.

> I am opening about 194 files and am seeing some weird behaviour. When i write 
> to
> the filehandles, I see it writes ok to some files and not to the others. But 
> I donot see
> any errors either.

How odd. Did you check for errors upon every open()? Perl should (if
warnings are enabled) warn you if you're using a broken filehandle.

You probably want the FileCache module, which lets your Perl code
pretend many files are open; it opens and closes filehandles as needed
so that your OS sees only a few files in use at any one time.

    use FileCache maxopen => 16;

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training


 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to