#30253 [NEW]: tempnam creates a non accesable file

From: Date: Mon, 27 Sep 2004 10:21:15 +0000
Subject: #30253 [NEW]: tempnam creates a non accesable file
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66756@lists.php.net to get a copy of this message
From: jorisvanmontfort at chello dot nl Operating system: windows 2000 PHP version: 4.3.9RC3 PHP Bug Type: IIS related Bug description: tempnam creates a non accesable file Description: ------------ When i use the tempnam() function a file is succefully created but it seems that the file is not writeable. I am running php 4.3.9 on IIS 5 as CGI on windows 2000. Reproduce code: --------------- <? // create a tempfile for the thumbnail $tempThumbnailFile = tempnam ("tmp", "thumb"); // write the contents of the zip entry to the tempfile $handle = fopen($tempThumbnailFile, 'a+'); fwrite($handle, $docData); fclose($handle); /* DO SOME PROCESSING ON THE FILE */ // Read the contents of the files into a string. $thumbnailData = fread(fopen($tempThumbnailFile, "r+"), filesize($tempThumbnailFile)); ?> Expected result: ---------------- I expect the a tempfile to be created and I expect to be able to acces this file for write acces in order to manipulate the file contents. Actual result: -------------- Warning: filesize(): Stat failed for C:\Windows\TEMP\thu8450.tmp (errno=2 - No such file or directory) and so on.................. The file is created i can find it in explorer. -- Edit bug report at http://bugs.php.net/?id=30253&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30253&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30253&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30253&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30253&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30253&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30253&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30253&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30253&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30253&r=support Expected behavior: http://bugs.php.net/fix.php?id=30253&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30253&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30253&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30253&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30253&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30253&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30253&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30253&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30253&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30253&r=mysqlcfg

« previous php.bugs (#66756) next »