Re: realpath() on MacOSX doesn't normalize the case of characters
| From: | Andreas Heigl | Date: | Wed, 05 Aug 2015 15:23:39 +0000 |
| Subject: | Re: realpath() on MacOSX doesn't normalize the case of characters | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87649@lists.php.net to get a copy of this message | ||
> Am 05.08.2015 um 17:06 schrieb Pierre Joye <pierre.php@gmail.com>:
>
> Hi,
>
> On Aug 4, 2015 7:23 PM, "Nicolas Grekas" <nicolas.grekas+php@gmail.com>
> wrote:
>>
>> Hello,
>>
>> I reported this bug one year ago (https://bugs.php.net/67220) and it is
> now
>> closed as "not a bug". I'd like this to be reconsidered.
>>
>> The documentation of realpath() says:
>>
>>> realpath() expands all symbolic links and resolves references to '/./',
>>> '/../' and extra '/' characters in the input path ***and returns
>>> the
>>> canonicalized absolute pathname***.
>>>
>>
>> the last part of this description is IMO what qualifies this behavior on
>> MacOSX as a bug.
>>
>> I'm asking for this now because I spend many hours on Syfony trying to
> find
>> an efficient workaround, and this is far from easy. Here is the fastest we
>> found (it's a mix of scandir()+getcwd()+caching):
>> https://github.com/symfony/symfony/pull/15443
>>
>> If realpath were behaving on OSX the same as it does on Windows (and
> Linux),
>> I could remove 60 lines of wtf lines.
>>
>> Do anyone else agree?
>
> I think it could be fixed but can be tricky.
>
> For windows, there is no path normalization either btw. It would makes
> realpath more expensive.
>
> Also as far as I remember the case sensitivity on osx (for hfs) can be
> enabled optionally, or?
Case sensitivity is not an issue of OS X but of the underlying Filesystem which is by default on
HFS+ disabled. You can enable case sensitivity by reformating the partition using case-sensitive
HFS+
Cheers
Andreas
--
Andreas Heigl
andreas@heigl.org