Boost logo

Boost Users :

Subject: Re: [Boost-users] [filesystem] is path comparison case-insensitive on Windows?
From: Rainer Deyke (rainerd_at_[hidden])
Date: 2012-06-16 03:44:54


On 2012-06-15 22:41, Nathan Ridge wrote:
>
>> Isn't it what you
>> want? http://www.boost.org/libs/filesystem/v3/doc/reference.html#equivalent
>
>
> Not quite. Suppose I want to test whether a file has a "jpg" extension (case
> insensitive on Windows). I would like to be able to do:
>
> path file = ...;
> path jpeg_ext = ".jpg";
> ....
> if (file.extension() == jpeg_ext)
>
> and have the comparison return true for "something.JPG" on Windows.

In this particular case, you should really use case-insensitive
comparison on /all/ platforms (and check for ".jpeg" in addition to
".jpeg"). It's not unusual to find files with an uppercase ".JPG"
extension on case-sensitive file systems.

-- 
Rainer Deyke (rainerd_at_[hidden])

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