Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
XP is just a number
 
PerlMonks  

Re: Opening multiple filehandlers

by AgentM (Curate)
on Apr 06, 2001 at 21:00 UTC ( #70518=note: print w/ replies, xml ) Need Help??


in reply to Opening multiple filehandlers

Be very careful with this! While you may have a legitimate reason for doing this, you can hardly anticipate its failures as cross-platform code. The standard DOS install allowed for 20 file descriptors system-wide! That means that opening 100 would merely crash your program. You would effectively be left with 17 or less file descriptors. On modern OSs, each program may be limited to a certain no. (minimally X by POSIX (Petruchio has my book on this)) and also the system-wide total. It might simply be better to open each file in the loop, output the info, close the filehandle and reuse it.

AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.


Comment on Re: Opening multiple filehandlers
Re: Re: Opening multiple filehandlers
by extremely (Priest) on Apr 06, 2001 at 23:34 UTC
    Historically, many unices are set to either 128 or 256. These days I believe Linux is most often at either 256 or 1024 depending on the distribution and sysadmin tinkering. AFAIK the *BSD family tend to 256. I am unaware of PC or Mac defaults and whether they can be changed. IRIX was 256, Sun was 256, HP was 256; last I checked. If you keep it reasonable, say less than 100 you seem to be ok just about everywhere but the pathological cases.

    --
    $you = new YOU;
    honk() if $you->love(perl)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://70518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-04-17 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (439 votes), past polls