|
Posted by Jerry Stuckle on 12/09/07 00:00
alexandis@gmail.com wrote:
> I now had chance to check this.
> At least the following DIDN'T WORK - even being-written files were
> shown:
>
> while (false !== ($filename = readdir($handle))) {
> if ($filename != "." && $filename != "..") {
> $fp = fopen($resultsourcefile_dir.$filename, "a
> +");
> if (flock($fp, LOCK_EX)) {
> flock($fp, LOCK_UN);
> //display the file
> }
> }
> }
>
> p.s. I had to use "a+", not "a", because I also read from the file
> inside the loop. But if it doesn't matter, right? Maybe it's just a
> matter of OS... :(
>
This will work if the other application also uses flock(). But if it
doesn't, there isn't any real way you can tell.
The bottom line is - if the other application doesn't "play nice",
there's not much your application can do.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|