Hell, am I the only one using flock in PHP with LOCK_NB? According to PHP: flock – Manual there is a parameter value of 4 for LOCK_NB – that means “check for lock only, but do nothing else”... Initial problem was that there is not timeout-parameter (like “wait for 10 seconds until you catch the lock or return with error if not”). Now wanting to implement that by hand I got an “Illegal operation argument” passing 4 (LOCK_NB) to flock.
Thanks to open source we can check the source to see the problem:
if (act < 1 || act > 3) {
php_error(E_WARNING, “Illegal operation argument”);
RETURN_FALSE;
}
Now what’s wrong? the code (PHP 4.3.x) or the documentation ?
What’s the commonly used workaround for locking files with timeout if it’s not even possible to “check” for a lock nor pass any timeout parameters?
Recent comments
14 weeks 43 min ago
14 weeks 1 day ago
16 weeks 23 hours ago
16 weeks 6 days ago
17 weeks 1 day ago
26 weeks 6 hours ago
26 weeks 6 hours ago
26 weeks 2 days ago
26 weeks 3 days ago
27 weeks 2 days ago