note 8411 added to flock

From: Date: Tue, 12 Sep 2000 01:22:38 +0000
Subject: note 8411 added to flock
Groups: php.notes 
Request: Send a blank email to php-notes+get-4735@lists.php.net to get a copy of this message
I had to play around a bit with flock() until I understood the explanations on this page. Here's what I figured out: You use flock($fp,2) to lock a file while writing to it. If it is already locked the server seems to wait until it's unlocked. If you want instant feedback use flock($fp,6) which will return immediately if the file is already locked. That's what LOCK_NB is all about. http://www.php.net/manual/function.flock.php

« previous php.notes (#4735) next »