Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Opening multiple filehandlers

by AgentM (Curate)
on Apr 06, 2001 at 21:00 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://70518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found