php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53811 filesize disregards case sensitive file system
Submitted: 2011-01-22 06:19 UTC Modified: 2011-01-22 19:37 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: jl_ewing at hotmail dot com Assigned:
Status: Wont fix Package: Filesystem function related
PHP Version: 5.3.5 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-01-22 06:19 UTC] jl_ewing at hotmail dot com
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
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-22 13:16 UTC] pajoye@php.net
-Status: Open +Status: Wont fix
 [2011-01-22 13:16 UTC] pajoye@php.net
No, it should not. Case insensitive NTFS partition support is highly experimental 
and requires special cases and APIs calls. We aren't going to support that any 
time soon.
 [2011-01-22 18:12 UTC] jl_ewing at hotmail dot com
You mean case sensitive NTFS partition support is highly experimental?  I'm calling bull on that as the feature has been around since at least 2005 and Microsoft FULLY supports it and if you were to search TechNet you would find many articles regarding the topic.
 [2011-01-22 18:22 UTC] pajoye@php.net
Yes, that's what I meant.

Your statement about MSFT fully supporting it with all possible functions is 
wrong, btw.
 [2011-01-22 19:37 UTC] jl_ewing at hotmail dot com
I think you misunderstood.  I was calling bull on the "highly experimental" statement.

Microsoft fully supports the use the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive registry key and case sensitivity in the NTFS file system.  In fact case sensitive file systems is a POSIX requirement.

According to Microsoft:

"POSIX requires a certain amount of functionality from the file system, such as the ability for a file to have more than one name (or hard links) and case-sensitive file naming. Neither FAT nor HPFS supports these features, which is another reason why a new file system was required for Windows NT. NTFS supports both hard links and case-sensitive naming. If you want to run in a POSIX-conforming environment, you need at least one NTFS disk partition on your computer."

I don't recall stating anything about "all possible functions" and indeed a bulk of the applications (notepad, for example) and utilities do not understand what it means to have case sensitivity enabled or how that translates to the  file system.  Of course I wasn't asking Microsoft to fix that, I was only asking for PHP to be able to support what the underlying file system supports.

If there are, in fact, separate API calls required to support reading/writing to case sensitive files then I understand the task and respectfully withdraw my request at this time.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC