Gen. partnerAlgotech

PHP function flock()

Portable advisory file locking

|
September 11, 2019

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.

Other resources

Official documentation for the flock function

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.