summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class5
1 files changed, 3 insertions, 2 deletions
diff --git a/it.class b/it.class
index 30dbf92..a96032f 100644
--- a/it.class
+++ b/it.class
@@ -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;
}