Syntax: bool Flock (int fp, int twist [, int wouldblock])
Description:
PHP provides a hand-held (portable) locked way to make the complete file in a consulting channel (advisory Way).
Flock () operates on the open file metrics FP, twist can be one of the following values:
Set twist to Lock_sh to obtain a shared lock (read). (The version before PHP 4.0.1 is set to 1) Set twist to LOCK_EX to obtain a unique lock (write). (The version before PHP 4.0.1 is set to 2) Set twist to Lock_un to free a lock (shared or unique). (The version before PHP 4.0.1 is set to 3) If you do not want to flock () The block, set the parameter twist to LOCK_NB. (The version before PHP 4.0.1 is set to 4) Flock () allows you to perform a simple read/write approach that can be used on every platform (including UNIX and Windows). If the lock is able to block, the third option is set to True (Ewouldblock errno condition).
Flock () succeeds returns True, and returns false for failure.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.