Boost logo

Boost Users :

Subject: Re: [Boost-users] [filesystem] is path comparison case-insensitive on Windows?
From: Will Mason (willchido_at_[hidden])
Date: 2012-06-15 14:22:02


Hello,

On Fri, Jun 15, 2012 at 4:55 AM, Mateusz Loskot <mateusz_at_[hidden]> wrote:

> On 15 June 2012 07:12, Nathan Ridge <zeratul976_at_[hidden]> wrote:
> >
> > I couldn't find this info in the Filesystem documentation, so I
> > thought I'd ask here: is equality comparison between path objects
> > case-insensitive on Windows?
>
> Two paths are compared using lexicographical comparison, it says in the
> docs.
> Looking at the implementation, it is case-sensitive lexicographical order.
>
> BTW, the documentation only points
>
> "Case sensitivity is a property of the pathname itself, and not the
> platform"
>

I would suggest that case sensitivity is a property of the file system, not
the path name and certainly not the platform.

In our product we use boost::filesystem extensively in a cross-platform
context, and we always check case sensitivity whenever we see a file system
that we haven't seen before. The check consists in taking the name of a
known file in the new file system, converting it to upper or lower case
depending on the current state of the name, and checking whether the
converted name exists or not. This of course will fail in a situation where
the files hello and HELLO exist in the same directory, but we assume that
case is an aberration.

Cheers,
Will

>
> So, IMO it is correct to assume filesystem::path is case-sensitive
> regardless OS.
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net