testing locking a file
<p>I <a href="http://stackoverflow.com/questions/10487505/changing-a-files-single-character/10487534#10487534">locked a file</a> and I am trying to test how the system reacts to a locked file. 
I would like other processes to wait for the process to be released until they can <code>require_once</code> that file again and not to come back with an error.</p>

<p>The problem is no matter what I do, I don't seem to be able to lock the file and do some waiting while another process asks for the file, and see the reaction of the system to that locked file.</p>

<p>I tried<br>
1. <code>sleep()</code> which doesn't work, it halts the whole php engine.<br>
2. I created a batch file that simply pauses until you hit enter. and used <code>exec("cmd.exe /c START c:\\1.bat");</code></p>

<p>So the hunch is that all processes are actually being one serial queue of tasks, so that if one is paused for any reason, so are all others ?</p>

<p>so How can I test if a file is locked ?<br>
But of course if I am right, what's the point in locking the file whatsoever if other processes can't access it anyway?</p>
