Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::filesystem::native
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2016-11-10 17:19:20


On 11/11/2016 10:40, Christopher J. Pisz wrote:
> On 11/10/2016 2:19 PM, Fernando Gomes da Silva wrote:
>> std::cout << boost::filesystem::native("C://PATH") << std::endl;
>> std::cout << boost::filesystem::native("C:/PATH") << std::endl;
>> std::cout << boost::filesystem::native("C:\\PATH") << std::endl;
>> std::cout << boost::filesystem::native("C:\PATH") << std::endl;
>> std::cout << boost::filesystem::native("\PATH") << std::endl;
>> std::cout << boost::filesystem::native("\\PATH") << std::endl;
>> std::cout << boost::filesystem::native("/PATH") << std::endl;
>> std::cout << boost::filesystem::native("//PATH") << std::endl;
>
> 0
> 0
> 0
> 0
> 1
> 0
> 0
> 0
>
> Not at all the expected results.

That's especially weird considering that "\P" should be an invalid
escape sequence, which should give you a compiler warning/error and/or
should make "\PATH" give identical results to "\\PATH".

Unless you further escaped these before compiling it?


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