From:             whistl0r+phpbug at googlemail dot com
Operating system: Windows
PHP version:      5.2.9
PHP Bug Type:     Filesystem function related
Bug description:  tempnam() changes to %TEMP% instead of returning false

Description:
------------
I wanted to check, how tempnam() handles file system limits.
On NTFS, just 65535 files per directory are allowed.

Reproduce code:
---------------
<?php
// Keep script alive
ignore_user_abort(1);
@set_time_limit(0);

$dir = 'C:\Test';
(if (!file_exists($dir))
{
        // Create Test directory
        mkdir($dir, null, true);
}

$i = 0;
while (tempnam($dir, 'Foobar'))
{
        $i++;
}

printf('%u files created', $i);

Expected result:
----------------
The script should stop, because tempnam() should return "false".
The function should return "false", because when 65535 files are in the 
specified directory, you reached a limit and aren't able to write to 
C:\Test anymore.

Actual result:
--------------
The script will keep running.
After the 65535. file is created in C:\Test, the function will ignore 
the specified directory and switch to %temp% (which is usually 
C:\Windows\Temp).

-- 
Edit bug report at http://bugs.php.net/?id=47834&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47834&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47834&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47834&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47834&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47834&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47834&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47834&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47834&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47834&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47834&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47834&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47834&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47834&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47834&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47834&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47834&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47834&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47834&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47834&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47834&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47834&r=mysqlcfg

Reply via email to