diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-28 11:32:45 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-28 11:32:45 +0100 |
commit | a76ff563d645ce456d6366b34fd763d5b11ee0d3 (patch) | |
tree | 920117f5306047bd350b00dea79d6027474217d5 /lib/helper.php | |
parent | 7ec1c0703d49639c4a5da1a593f742ac581158f3 (diff) | |
download | nextcloud-server-a76ff563d645ce456d6366b34fd763d5b11ee0d3.tar.gz nextcloud-server-a76ff563d645ce456d6366b34fd763d5b11ee0d3.zip |
fix temporary file creation
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/helper.php b/lib/helper.php index 3c76d38328b..fc0b8867703 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -425,8 +425,11 @@ class OC_Helper { * temporary files are automatically cleaned up after the script is finished */ public static function tmpFile($postfix=''){ - $file=tempnam(get_temp_dir(),'OC_TMP_').$postfix; + $file=get_temp_dir().'/'.md5(time().rand()).$postfix; + $fh=fopen($file,'w'); + fclose($fh); self::$tmpFiles[]=$file; + error_log($file); return $file; } @@ -436,6 +439,7 @@ class OC_Helper { public static function cleanTmp(){ foreach(self::$tmpFiles as $file){ if(file_exists($file)){ + error_log("clean $file"); unlink($file); } } |