OK, so unlink() won't wait, and that's fine. But what happens to the script(a) what opens and locks a file? when unlink() was done by another script(b), can the script(a) get the content of the file? Let's see... ------------------------------------------------------ (1) Open two terminals. (2) Execute "php lock-and-sleep.php" in a terminal and Execute "php unlink-it.php" in another terminal ------------------------------------------------------ if a file was deleted by another process, file_get_contents emits waning: -------------------------------- PHP Warning: file_get_contents(/var/www/phpkobo/research/php-basic/file-lock/unlink-locked-file2/data/test.txt): failed to open stream: No such file or directory in /var/www/phpkobo/research/php-basic/file-lock/unlink-locked-file2/lock-and-sleep.php on line 31 -------------------------------- raises and return false because it can't find it. simply put "@" in front of "file_get_contents" to surpress the warning.