From: Operating system: PHP version: Irrelevant Package: Directory function related Bug Type: Feature/Change Request Bug description:RFE: tempdir() countrpart to tempnam()
Description: ------------ It would be really useful to have the ability to create a tempdir, with a unique name, which we know we can write to, and will be automatically cleaned up. For example, if I want to run an external command (with exec() ) which will write to a file, where: - it must be known that file-creation can succeed - the file does not exist at the moment Test script: --------------- Some applications will refuse to overwrite an existing file (that we created with tempnam()), because they don't want to clobber it. What we effectively need is a race-free way to assign a temp-filename without actually creating the file. Using tmpfile() doesn't help, because we can't pass a file-handle to php's exec(). -- Edit bug report at http://bugs.php.net/bug.php?id=52074&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52074&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52074&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52074&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52074&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52074&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52074&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52074&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52074&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52074&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52074&r=support Expected behavior: http://bugs.php.net/fix.php?id=52074&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52074&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52074&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52074&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52074&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52074&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52074&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52074&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52074&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52074&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52074&r=mysqlcfg