Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: if (open(FH, $path)) { ?

by haoess (Curate)
on May 03, 2004 at 14:48 UTC ( #350026=note: print w/ replies, xml ) Need Help??


in reply to if (open(FH, $path)) { ?

If you use -r, -w, -x etc. in your programm, be sure not to get race conditions. These are often misused functions. The right way is: Try to do what you want (= read file), and print an error message if that fails. The other way round is: Can I do this, can I do that? and then perform your action. This is the race condition, because between your tests and your action many things can change (i. e. file permissions).

-- Frank


Comment on Re: if (open(FH, $path)) { ?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-10-01 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (386 votes), past polls