#29952 [NEW]: tempnam() always returns system temp directory

From: Date: Thu, 02 Sep 2004 13:10:57 +0000
Subject: #29952 [NEW]: tempnam() always returns system temp directory
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65634@lists.php.net to get a copy of this message
From: patripaq at hotmail dot com Operating system: Windows 2000 Server PHP version: 4.3.7 PHP Bug Type: Filesystem function related Bug description: tempnam() always returns system temp directory Description: ------------ When I call the tempnam() function, it always returns a file located in the system temp directory (C:\WINNT\TEMP) even if I specify an existing directory. Reproduce code: --------------- class TxtFile { var $_tmp_dir = '/web/tmp/'; function gentmp() { $tmp = ''; if( is_dir( $this->_tmp_dir ) ) $tmp = tempnam( $this->_tmp_dir, get_class($this) ); // $tmp is always located in 'C:\WINNT\TEMP\' even // if specified directory exists... return $tmp; } } $txt = new TxtFile(); echo $txt->gentmp(); Expected result: ---------------- /web/tmp/txt9375.tmp Actual result: -------------- C:\WINNT\TEMP\txt9375.tmp -- Edit bug report at http://bugs.php.net/?id=29952&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29952&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29952&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29952&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=29952&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29952&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29952&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29952&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29952&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29952&r=support Expected behavior: http://bugs.php.net/fix.php?id=29952&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29952&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29952&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29952&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29952&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29952&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29952&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29952&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29952&r=float

« previous php.bugs (#65634) next »