Re: Directory separators on Windows
| From: | Fleshgrinder | Date: | Sat, 01 Apr 2017 09:22:11 +0000 |
| Subject: | Re: Directory separators on Windows | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98714@lists.php.net to get a copy of this message | ||
On 4/1/2017 11:13 AM, Rasmus Schultz wrote:
> So to summarize, a normalize_path() function should:
>
> 1. Fully normalize to an absolute path with no platform-specific separators
> 2. Have corrected case (for files/dirs that do exist.)
> 3. Have normalized (upper-case) drive-letter on Windows
>
> There's also network file-system paths on Windows with a different syntax
> to consider? I don't know much about that...
>
1. cannot be guaranteed by a normalization function, because the parts
the dots point to might not exist. Resolving them without knowing if we
are dealing with a symbolic or hard link is impossible.
UNC paths work the same as normal paths, the only difference is their
prefix (e.g.
\\ComputerName\), in other words, they can be treated
like a schemeless URL.
Verbatim paths are not supported by PHP anyways, hence, they can be ignored.
--
Richard "Fleshgrinder" Fussenegger