php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29952 tempnam() always returns system temp directory
Submitted: 2004-09-02 15:10 UTC Modified: 2004-09-02 15:43 UTC
From: patripaq at hotmail dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.7 OS: Windows 2000 Server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: patripaq at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-09-02 15:10 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-02 15:43 UTC] derick@php.net
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? 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 12:01:28 2024 UTC