diff options
-rw-r--r-- | it.class | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1037,8 +1037,9 @@ static function file_put($filename, $data, $p = array()) if ($p['mkdir'] && $filename != "-") @mkdir(dirname($filename)); - if (($result = file_put_contents($filename == "-" ? "php://stdout" : "$filename.tmp." . getmypid(), $data)) !== false && $filename != "-") - $result = rename("$filename.tmp." . getmypid(), $filename); + $tmpfile = dirname($filename) . "/.it_put." . basename($filename) . "." . getmypid(); + if (($result = file_put_contents($filename == "-" ? "php://stdout" : $tmpfile, $data)) !== false && $filename != "-") + $result = rename($tmpfile, $filename); return $result; } |