ID:               36290
 Updated by:       [EMAIL PROTECTED]
 Reported By:      info at silisoftware dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Filesystem function related
 Operating System: Windows XP Pro SP2
 PHP Version:      4.4.2
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2006-02-05 02:19:00] info at silisoftware dot com

Description:
------------
tempnam() returns a temp filename, and creates the file. However, it
creates it on the wrong drive. For example:

$tempname = tempnam('', 'foo');
echo $tempname.'<br>';
echo realpath($tempname).'<br>';

This outputs:

\foo49.tmp
e:\foo49.tmp

Notice the returned filename has no drive letter. The file is created
(to prevent race condition) in C:\ but realpath() resolves that to E:\
(the last drive letter of physical harddrives in this system).

For reference:
 getenv('TMP')    == 'C:\WINDOWS\TEMP'
 getenv('TMPDIR') == ''

Reproduce code:
---------------
$tempname = tempnam('', 'foo');
echo $tempname.'<br>';
echo realpath($tempname).'<br>';



Expected result:
----------------
c:\foo49.tmp
c:\foo49.tmp


Actual result:
--------------
\foo49.tmp
e:\foo49.tmp



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36290&edit=1

Reply via email to