Re: problem using flock()
| From: | 10,000 Screaming Monkeys | Date: | Wed, 17 Jan 2001 21:33:11 +0000 |
| Subject: | Re: problem using flock() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35160@lists.php.net to get a copy of this message | ||
On 01/13, jeremy brand rearranged the electrons to read:
> Hello 10,000 Screaming Monkeys,
> (Sorry, I couldn't resist!)
's alright. That's what it's there for. ;)
> You should test the return value of flock(), not just run it. It is
> designed to tell you whether or not something is safe to do, and since
> you are not testing the result, you are simply ignoring what it is
> trying to tell you.
>
> I have a small script that uses flock():
> http://www.nirvani.net/software/dr-fun/
Thanks! That's a good, basic example to help get me started. I am
intentionally not using a database for the logging, because it doesn't
make much sense to add the overhead just to increment a number on a
single line of a file whenever something's downloaded.
Thanks, also, to Mukul Sabharwal for your suggestion.
I'll give them both a try and see what works best in my environment.
Regards,
Jamie
--
Nurse! I spy gypsies! Run!
<php@in-flux.org> (Single purpose Email address)