Boost C++ Libraries: Ticket #5405: Filesystem does not handle the path prefix of windows correct https://svn.boost.org/trac10/ticket/5405 <p> The filesystem V3 cannot handle the special windows prefix <code>\\?\</code> properly. The resulting path and file names are wrong. </p> <p> A simple example to reproduce the problem </p> <pre class="wiki">boost::filesystem::path local_path(L"\\\\?\\C:\\"); boost::filesystem::directory_iterator directoryContent(local_path); const std::wstring name1 = directoryContent-&gt;path().filename().wstring(); std::wcout &lt;&lt; "Name 1 == " &lt;&lt; name1 &lt;&lt; std::endl; ++directoryContent; const std::wstring name2 = directoryContent-&gt;path().filename().wstring(); std::wcout &lt;&lt; "Name 2 == " &lt;&lt; name2 &lt;&lt; std::endl; </pre><p> The output should be the file names on the root folder of drive C. In my case </p> <pre class="wiki">Name 1 == $Recycle.Bin Name 2 == 00120.mpls </pre><p> The observed names are </p> <pre class="wiki">Name 1 == $Recycle.Bin Name 2 == C:00120.mpls </pre><p> 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. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5405 Trac 1.4.3 michael.kaes@… Thu, 31 Mar 2011 10:03:14 GMT attachment set https://svn.boost.org/trac10/ticket/5405 https://svn.boost.org/trac10/ticket/5405 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_filesystem.patch</span> </li> </ul> <p> Patch for the described issue </p> Ticket Beman Dawes Sat, 09 Apr 2011 14:36:40 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5405#comment:1 https://svn.boost.org/trac10/ticket/5405#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Your patch will be applied later today. </p> <p> A new ticket, 5448, has been opened to deal with the more general problem. I'll peck away at that as time permits. </p> <p> Thanks, </p> <p> --Beman </p> Ticket Beman Dawes Sun, 10 Apr 2011 02:00:38 GMT <link>https://svn.boost.org/trac10/ticket/5405#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5405#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/71157" title="Fix #5405. Note that this is only a partial fix. The issue is much ...">[71157]</a>) Fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5405" title="#5405: Bugs: Filesystem does not handle the path prefix of windows correct (closed: fixed)">#5405</a>. Note that this is only a partial fix. The issue is much larger; see ticket 5448 for details. </p> </description> <category>Ticket</category> </item> </channel> </rss>