]> git.wh0rd.org Git - tt-rss.git/commitdiff
add make_lockfile()
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 12 Feb 2006 07:21:52 +0000 (08:21 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 12 Feb 2006 07:21:52 +0000 (08:21 +0100)
functions.php

index d502d08d4a4b86348d8c00a07fcc1f9bb9fa4de2..55e785488c80ef1fbd5617cfba8a15a0d31111cd 100644 (file)
                } 
        }
 
+       function make_lockfile($filename) {
+               $fp = fopen($filename, "w");
+
+               if (flock($fp, LOCK_EX | LOCK_NB)) {            
+                       return $fp;
+               } else {
+                       return false;
+               }
+       }
+
 ?>