PHP function flock()
Availability in PHP 4.0
Portable advisory file locking
Parameters
| Parameter | Data type | Default value | Note |
|---|---|---|---|
$handle |
resource |
not | An open file pointer. |
$operation |
int |
not | operation is one of the following: LOCK_SH to acquire a shared lock (reader). @param int $wouldblock [optional] The optional third argument is set to true if the lock would block (EWOULDBLOCK errno condition). |
$wouldblock |
int |
null | The optional third argument is set to true if the lock would block (EWOULDBLOCK errno condition). |
Return values
bool
Returns true on success, otherwise false on failure.