[Boost-bugs] [Boost C++ Libraries] #5405: Filesystem does not handle the path prefix of windows correct

Subject: [Boost-bugs] [Boost C++ Libraries] #5405: Filesystem does not handle the path prefix of windows correct
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-31 10:02:43


#5405: Filesystem does not handle the path prefix of windows correct
------------------------------------+---------------------------------------
 Reporter: michael.kaes@… | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: |
------------------------------------+---------------------------------------
 The filesystem V3 cannot handle the special windows prefix {{{\\?\}}}
 properly.
 The resulting path and file names are wrong.

 A simple example to reproduce the problem

 {{{
 boost::filesystem::path local_path(L"\\\\?\\C:\\");
 boost::filesystem::directory_iterator directoryContent(local_path);

 const std::wstring name1 = directoryContent->path().filename().wstring();
 std::wcout << "Name 1 == " << name1 << std::endl;

 ++directoryContent;

 const std::wstring name2 = directoryContent->path().filename().wstring();
 std::wcout << "Name 2 == " << name2 << std::endl;
 }}}


 The output should be the file names on the root folder of drive C.
 In my case
 {{{
 Name 1 == $Recycle.Bin
 Name 2 == 00120.mpls
 }}}

 The observed names are
 {{{
 Name 1 == $Recycle.Bin
 Name 2 == C:00120.mpls
 }}}

 The second name is not correct.
 I traced it down to the root_directory_start function in the path.cpp.
 Attached is a patch that solved my issue.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5405>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC