Re: [Python-ideas] Small enhancement to os.path.splitext

Also note that there are really THREE variations: Case sensitive (Unix/mac normally) Case preserving (windows normally) Case insensitive (some legacy fs) IMHO gcc treating .c and .C is annoying. I usually get .JPG instead of .jpg when windows apps pick the extension for me. Also annoying. Notwithstanding that you can't do case insensitive compare without knowing the file system locale otherwise .GIF != .gif. So this is a mess. Furthermore it's not just extensions. Some names are conventionally case sensitive. And if I write #include "foo.h" and have foo.h and FOO.h you better get the right one. If I'm filtering unsafe filetypes are .EXE and .PL unsafe? Probably most useful is to provide access to fs locale and case sensitivety mode and leave rest for now. --- Bruce (via android) On Apr 23, 2010 4:49 AM, "Paul Moore" <p.f.moore@gmail.com> wrote: On 23 April 2010 12:34, Lie Ryan <lie.1296@gmail.com> wrote:
Good point. Which I guess boils down to saying that if there's no consensus, then nothing should be added to the stdlib (which is a conclusion I'm happy with). Paul. _______________________________________________ Python-ideas mailing list Python-ideas@python.org ht...

On 23 April 2010 15:21, Bruce Leban <bruce@leapyear.org> wrote:
Probably most useful is to provide access to fs locale and case sensitivety mode and leave rest for now.
That was my original suggestion - unfortunately I only know how to do this for Windows, and my research seems to indicate that it might not even be possible on Linux. If someone can give me some pointers on how to check case sensitivity for a filesystem on Linux/Unix/POSIX and MacOS, I'm willing to try to create a suitable patch for the stdlib. I don't consider writing a file then reading it back as a way of doing this, as there may be permission issues, and it'll trigger filesystem notification hooks, etc, so it's not really suitable as a stdlib solution (although obviously it's a fine solution for an application to use if the application design makes it appropriate...) Paul.

On 23 April 2010 15:21, Bruce Leban <bruce@leapyear.org> wrote:
Probably most useful is to provide access to fs locale and case sensitivety mode and leave rest for now.
That was my original suggestion - unfortunately I only know how to do this for Windows, and my research seems to indicate that it might not even be possible on Linux. If someone can give me some pointers on how to check case sensitivity for a filesystem on Linux/Unix/POSIX and MacOS, I'm willing to try to create a suitable patch for the stdlib. I don't consider writing a file then reading it back as a way of doing this, as there may be permission issues, and it'll trigger filesystem notification hooks, etc, so it's not really suitable as a stdlib solution (although obviously it's a fine solution for an application to use if the application design makes it appropriate...) Paul.
participants (2)
-
Bruce Leban
-
Paul Moore