#30730 [NEW]: Filename path length limit broken on NTFS volume, using rename

From: Date: Tue, 09 Nov 2004 07:15:55 +0000
Subject: #30730 [NEW]: Filename path length limit broken on NTFS volume, using rename
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68828@lists.php.net to get a copy of this message
From: dev at viapanda dot com Operating system: Windows XP SP2 PHP version: 4.3.9 PHP Bug Type: Filesystem function related Bug description: Filename path length limit broken on NTFS volume, using rename Description: ------------ I can't find a better summary... The issue looks complex to me. By using the rename function, you can create a path whose total length is superior to 255 (?), wich "appears" to be some limit on NTFS. Once you renamed your dir, the files under can't be deleted nor renamed using explorer... And php is_file stops working I'm too dumb to understand the windows ntfs spec... So, the issue is: "rename() allows you to create path longer than a limit that triggers problems..." Reproduce code: --------------- // Create a directory @mkdir('c:/test'); // Create a file in that directory $path='c:/test/whatever_the_name_of_this_file'; $fp=@fopen($path, 'wb+'); @fclose($fp); // Rename that directory in order that the file full path will be long enough to trigger the bug $destination=str_pad('c:/test', 250, '0'); rename('c:/test', $destination); Expected result: ---------------- (i) If the whole is incorrect, I would like to have an error from the rename function, and my dir shouldn't be renamed. (ii) If this is correct, then is_file (and probably other functions) should work correctly on this file Actual result: -------------- (i) something is broken in windows (duh!), as you can't rename or delete the file (ii) php functions like is_file, don't work on that file -- Edit bug report at http://bugs.php.net/?id=30730&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30730&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30730&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30730&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30730&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30730&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30730&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30730&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30730&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30730&r=support Expected behavior: http://bugs.php.net/fix.php?id=30730&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30730&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30730&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30730&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30730&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30730&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30730&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30730&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30730&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30730&r=mysqlcfg

« previous php.bugs (#68828) next »