From: Operating system: Windows XP PHP version: 5.3.5 Package: Filesystem function related Bug Type: Bug Bug description:filesize disregards case sensitive file system
Description: ------------ Windows XP with NTFS and Case in-sensitivity is DISABLED (e.g. the file system is case sensitive). PHP 5.3.5 is VC6 x86 Non Thread Safe ZIP file extracted \PHP535 directory HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive 0 C:\opt\files>dir Volume in drive C is Boot Volume Serial Number is 84D1-331E Directory of C:\opt\files 01/21/2011 11:03 PM <DIR> . 01/21/2011 11:03 PM <DIR> .. 01/21/2011 11:03 PM 3,400 testA.out 01/21/2011 11:03 PM 550 testa.out 2 File(s) 3,950 bytes 2 Dir(s) 65,225,863,168 bytes free C:\PHP535>php -f test.php (see test script) Array ( [testA.out] => 550 [testa.out] => 550 ) The file that was created first seems to be the one that it uses. On NTFS file systems that are case sensitive filesize should pick up the appropriate file sizes Test script: --------------- $dir = '\\opt\\files'; $index = array(); $files = scandir($dir); foreach ($files as $file) { if (is_file($dir . '\\' . $file)) { $sizeX = filesize($dir. "/$file"); $index[$file] = $sizeX; unset ($file, $sizeX); } } print_r($index); Expected result: ---------------- Array ( [testA.out] => 3400 [testa.out] => 550 ) Actual result: -------------- Array ( [testA.out] => 550 [testa.out] => 550 ) -- Edit bug report at http://bugs.php.net/bug.php?id=53811&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53811&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53811&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53811&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53811&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53811&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53811&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53811&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53811&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53811&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53811&r=support Expected behavior: http://bugs.php.net/fix.php?id=53811&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53811&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53811&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53811&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53811&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53811&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53811&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53811&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53811&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53811&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53811&r=mysqlcfg