Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: best way to keep a simple count?

by brian_d_foy (Abbot)
on Apr 11, 2005 at 21:27 UTC ( [id://446780]=note: print w/replies, xml ) Need Help??


in reply to Re: best way to keep a simple count?
in thread best way to keep a simple count?

Some experts gave you bad advice. You need to read and update the file as one step, otherwise another process comes along and tries to do the same thing while you are in the middle. Either the count doesn't get incremented properly (both processes read the same value before either one wrote a new one), the count gets reset (one process reads the file just after it was truncated), or the count disappears.

--
brian d foy <brian@stonehenge.com>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-24 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found