Subject: [Boost-bugs] [Boost C++ Libraries] #11138: filesystem::path::canonical() failed with junction points on Windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-24 14:48:38
#11138: filesystem::path::canonical() failed with junction points on Windows
-----------------------------------------+------------------------
Reporter: yanggehua@⦠| Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.57.0 | Severity: Problem
Keywords: filesystem, path, canonical |
-----------------------------------------+------------------------
Hi,
In my recent use of filesystem in Boost 1.57, the call of
path::canonical() on Windows 7 returns an invalid path if part of the path
in question is a junction point.
This failure can be reproduced with the following code:
{{{#!C++
// "C:\Gehua" is a junction point of "D:\Gehua"
fs::path work("d:/Gehua/work");
fs::path work_canonical(fs::canonical(work));
std::wstring s = fs::canonical(work_canonical).native();
// True path passes
assert(s == L"d:/Gehua\\work");
// try the junction path
fs::path work_junction("c:/Gehua/work");
// this passes
assert(fs::exists(work_junction));
s = fs::canonical(work_junction).native();
// this one fails!
// s has value "c:/Gehua\\Gehua\\work"
assert(s == L"d:/Gehua\\work");
}}}
The call returned a value of "c:/Gehua\\Gehua\\work", which was wrong.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11138> 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:18 UTC