Case sensitive paths on Windows
We faced issues with handling paths on Windows and case sensitivity.
For example, when Fpath.relativize is called with the root path created from a string where a Windows drive letter is in the uppercase and the absolute path to relativize created from a string where a Windows drive letter is in the lowercase, the relativization fails (e.g, the root directory C:\my_directory and the absolute path to relativize c:\my_directory\subdirectory).
Likewise, comparing, for example, C:\my_directory and C:\\My_directory returns false under Windows.
I don't know what to do with this issue report.
Would it be possible to do relativization and comparison of Windows paths case-insensitively?
In the interest of not wasting each other's time please come up with:
- Exactly which functions you think need to be changed.
- Exactly how you think these functions to be changed, with examples.
- What is the rationale and use case for these changes to be performed.
That being said, in general fpath deals with functions in a platform independent manner without accessing the file system. That means in a purely syntactic way.
So it's likely not a good idea to perform these normalizations as they will likely break in specific cases. Generally it's better to let the system calls that accept paths to deal with the normalization, as this may involve Unicode case folding and normalization forms which are way beyond fpath abilities and, more importantly, because the exact way these normalizations are performed generally depend on the actual kind of file system you are acting upon which is unknown to fpath.
Finally if you have a strong need to compare file system paths usually it's better to realpath them which is available in the Unix module distributed with the compiler (and works on Windows).