From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 15BEB38708C1; Sat, 6 Mar 2021 16:11:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15BEB38708C1 From: "moritz at bunkus dot org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBsaWJzdGRjKysvOTk0MzBdIE5ldzogc3RkOjpmaWxlc3lz?= =?UTF-8?B?dGVtOjpwYXRoOiBVTkMgZGV2aWNlIHBhdGhzIHdpdGggXFw/XOKApiBub3Qg?= =?UTF-8?B?c3VwcG9ydGVkIHByb3Blcmx5?= Date: Sat, 06 Mar 2021 16:11:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: moritz at bunkus dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 16:11:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99430 Bug ID: 99430 Summary: std::filesystem::path: UNC device paths with \\?\=E2=80= =A6 not supported properly Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: moritz at bunkus dot org Target Milestone: --- Created attachment 50317 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50317&action=3Dedit test case highlighting the issue Paths such as \\?\C:\WINDOWS or \\?\UNC\LOCALHOST\c$\WINDOWS don't work properly with std::filesystem::path (e.g. exists() & is_directory() return false). According to Microsoft's documentation those are valid.[1] The corresponding variants starting with \\.\ seem to fare better (safe for= the root name & absolute issues, but I've filed 99333 for that already). boost::filesystem works fine with all of these paths. The attached sample program outputs the following, showing how Boost's & st= d's implementation differ: ----------------------------------------- std::filesystem::path for \\?\C:\WINDOWS is_aboslute 0 has_root_path 1 has_root_name 0 exists 0 is_directory 0 boost::filesystem::path for \\?\C:\WINDOWS is_aboslute 1 has_root_path 1 has_root_name 1 exists 1 is_directory 1 std::filesystem::path for \\?\UNC\localhost\c$\WINDOWS is_aboslute 0 has_root_path 1 has_root_name 0 exists 0 is_directory 0 boost::filesystem::path for \\?\UNC\localhost\c$\WINDOWS is_aboslute 1 has_root_path 1 has_root_name 1 exists 1 is_directory 1 std::filesystem::path for \\.\C:\WINDOWS is_aboslute 0 has_root_path 1 has_root_name 0 exists 1 is_directory 1 boost::filesystem::path for \\.\C:\WINDOWS is_aboslute 1 has_root_path 1 has_root_name 1 exists 1 is_directory 1 std::filesystem::path for \\.\UNC\localhost\c$\WINDOWS is_aboslute 0 has_root_path 1 has_root_name 0 exists 1 is_directory 1 boost::filesystem::path for \\.\UNC\localhost\c$\WINDOWS is_aboslute 1 has_root_path 1 has_root_name 1 exists 1 is_directory 1 ----------------------------------------- gcc mingw 10.2.0 from MXE (cross-compiling from Linux to Windows), Boost 1.= 74.0 [1] https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats=