diff options
-rw-r--r-- | it.class | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -84,15 +84,16 @@ static function log($name /* ... */) if (substr($fullfn, 0, 1) == "/") { - $existed = file_exists($fullfn); - file_put_contents($fullfn, $line, FILE_APPEND); - - if (!$existed) + if (!file_exists($fullfn)) { - @chgrp($fullfn, "www"); + @touch("$fullfn.tmp"); + @chgrp("$fullfn.tmp", "www"); + @rename("$fullfn.tmp", $fullfn); @unlink($basefn); @symlink($fullfn, $basefn); } + + file_put_contents($fullfn, $line, FILE_APPEND); } } |