Boost logo

Boost Users :

Subject: [Boost-users] [Filesystem V3] Directory iterator seems to be broken.
From: Michael Kaes (michael.kaes_at_[hidden])
Date: 2011-03-30 09:35:00


Hi all,

I have the following two programs. In filesystem V2:
-----------------------------------
boost::filesystem::wpath local_path(L"\\\\?\\C:\\");
boost::filesystem::wdirectory_iterator directoryContent(local_path);

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

++directoryContent;

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

In filesystem V3:
------------------------------------
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 of V2 for my machine is
Name 1 == $Recycle.Bin
Name 2 == 00120.mpls

This is correct and what I would expect.
The output for V3 is
Name 1 == $Recycle.Bin
Name 2 == C:00120.mpls

Which is incorrect. The root path is not correctly removed. Is this a
BUG in V3 or did something in the API changed that I have not seen
yet?

Regards,
Michael


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