flock
(PHP 3>= 3.0.7, PHP 4 >= 4.0.0)flock -- 锁定文件描述
bool flock (int fp, int operation [, int wouldblock])
PHP 支持在访问文件时完全的锁定文件(这意味着所有的访问程序不得不使用相同的锁定方式,或者它不工作)。
flock() 运行在打开的文件指针fp之上。
operation 是下列值之一:
获得一个共享锁(可读),设置为LOCK_SH (PHP 4.0.1以下设置为1);
获得一个互斥锁(只有自己可写),设置为LOCK_EX (PHP 4.0.1以下设置为2);
释放锁(释放共享锁或互斥锁),设置为LOCK_UN (PHP 4.0.1以下设置为3);
如果当锁定时你不想flock() 块,添加LOCK_NB (PHP 4.0.1以下设置为4)。
flock() 允许你在每一个平台上能被使用简单的读/写模式 (包括众多的 Unix 派生系统和 Windows系统). 如果你想锁住块,你可以设置第三个参数为 TRUE (EWOULDBLOCK errno condition)
flock() 返回 TRUE 为成功;返回 FALSE 为失败 (e.g. when a lock could not be acquired).
注意: 因为 flock() 需要一个文件指针,you may have to use a special lock file to protect access to a file that you intend to truncate by opening it in write mode (with a "w" or "w+" argument to 网站建设服务器脚本类\PHPPHP用户手册fancyfunction.fopen.html>fopen()).
警告
flock() 在NFS和其他的网络文件系统中将不工作。详细资料请查阅你的操作系统文件。
有些操作系统 flock() 的执行需要在一定的执行级别上。当使用多线程系统API象ISAPI,你不可以依赖flock()去保护文件,相反其他的 PHP 脚本正在同一的服务器的实例中平行线程中运行。

Outils d'IA chauds

Undresser.AI Undress
Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover
Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool
Images de déshabillage gratuites

Clothoff.io
Dissolvant de vêtements AI

Video Face Swap
Échangez les visages dans n'importe quelle vidéo sans effort grâce à notre outil d'échange de visage AI entièrement gratuit !

Article chaud

Outils chauds

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

VSCode Windows 64 bits Télécharger
Un éditeur IDE gratuit et puissant lancé par Microsoft

SublimeText3 version anglaise
Recommandé : version Win, prend en charge les invites de code !

SublimeText3 Linux nouvelle version
Dernière version de SublimeText3 Linux

Dreamweaver CS6
Outils de développement Web visuel
