#29952 [Opn->Bgs]: tempnam() always returns system temp directory

From: Date: Thu, 02 Sep 2004 13:43:52 +0000
Subject: #29952 [Opn->Bgs]: tempnam() always returns system temp directory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65636@lists.php.net to get a copy of this message
ID: 29952 Updated by: derick@php.net Reported By: patripaq at hotmail dot com -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Windows 2000 Server PHP Version: 4.3.7 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. /tmp/web exists on windows? Previous Comments: ------------------------------------------------------------------------ [2004-09-02 15:10:56] patripaq at hotmail dot com 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 this bug report at http://bugs.php.net/?id=29952&edit=1

« previous php.bugs (#65636) next »