php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #11645 tempnam( ) does not use TMP environment variable
Submitted: 2001-06-24 14:17 UTC Modified: 2001-06-27 02:51 UTC
From: jlim at natsoft dot com dot my Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.6 OS: Windows ME
Private report: No CVE-ID: None
 [2001-06-24 14:17 UTC] jlim at natsoft dot com dot my
The PHP manual states:

The behaviour of the tempnam() function is system dependent. On Windows the TMP environment variable will override the dir parameter.

However testing the following when my TMP env variable is set to \WINDOWS\TMP:

  print tempnam('/','z')

the result is:

  C:\zB312.TMP

This used to work fine in PHP 4.0.4pl1.

Thanks again, John



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-24 17:02 UTC] sniper@php.net
This is documentation problem. The given path takes precedence over TMPDIR environment variable (not TMP environment variable as it is in docs)

From php4/main/php_open_temporary_file.c:

/* {{{ php_open_temporary_file
 *
 * Unlike tempnam(), the supplied dir argument takes precedence
 * over the TMPDIR environment variable
 * This function should do its best to return a file pointer to a newly created
 * unique file, on every platform.
 */

This makes the function behave the same way on every system.

 [2001-06-27 02:51 UTC] danbeck@php.net
Documentation has been updated to reflect this issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC