#5405 closed Bugs (fixed)
Filesystem does not handle the path prefix of windows correct
Reported by: | Owned by: | Beman Dawes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | filesystem |
Version: | Boost 1.46.1 | Severity: | Problem |
Keywords: | Cc: |
Description
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.
Attachments (1)
Change History (3)
by , 12 years ago
Attachment: | boost_filesystem.patch added |
---|
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Your patch will be applied later today.
A new ticket, 5448, has been opened to deal with the more general problem. I'll peck away at that as time permits.
Thanks,
--Beman
comment:2 by , 12 years ago
Note:
See TracTickets
for help on using tickets.
Patch for the described issue