[Python-ideas] PEP 428 - object-oriented filesystem paths
Ronald Oussoren
ronaldoussoren at mac.com
Wed Oct 10 10:09:33 CEST 2012
On 8 Oct, 2012, at 16:28, Oleg Broytman <phd at phdru.name> wrote:
> On Mon, Oct 08, 2012 at 03:59:18PM +0200, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
>> On 8 Oct, 2012, at 13:07, Oleg Broytman <phd at phdru.name> wrote:
>>
>>> On Mon, Oct 08, 2012 at 12:00:22PM +0200, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
>>>> Or CIFS filesystems mounted on a Linux? Case-sensitivity is a file-system property, not a operating system one.
>>>
>>> But there is no API to ask what type of filesystem a path belongs to.
>>> So guessing by OS name is the only heuristic we can do.
>>
>> I guess so, as neither statvs, statvfs, nor pathconf seem to be able to tell if a filesystem is case insensitive.
>>
>> The alternative would be to have a list of case insentive filesystems and use that that when comparing impure path objects. That would be fairly expensive though, as you'd have to check for every element of the path if that element is on a case insensitive filesystem.
>
> If a filesystem mounted to w32 is exported from a server by CIFS/SMB
> protocol -- is it case sensitive? What if said server is Linux? What if
> said filesystem was actually imported to Linux from a Novel server by
> NetWare Core Protocol. It's not a fictional situation -- I do it at
> oper.med.ru; the server is Linux that mounts two CIFS and NCP filesystem
> and reexport them via Samba.
Even more fun :-). CIFS/SMB from Windows to Linux or OSX behaves like a case-preserving filesystem on the systems I tested. Likewise a NFS filesystem exported from Linux to OSX behaves like a case sensitive filesystem if the Linux filesystem is case sensitive.
All in all the best we seem to be able to do is use the OS as a heuristic, most Unix filesystems are case sensitive while Windows and OSX filesystems are case preserving.
Ronald
>
> Oleg.
> --
> Oleg Broytman http://phdru.name/ phd at phdru.name
> Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
More information about the Python-ideas
mailing list