public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/99430] New: std::filesystem::path: UNC device paths with \\?\… not supported properly
@ 2021-03-06 16:11 moritz at bunkus dot org
  2021-03-07 16:33 ` [Bug libstdc++/99430] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: moritz at bunkus dot org @ 2021-03-06 16:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99430

            Bug ID: 99430
           Summary: std::filesystem::path: UNC device paths with \\?\… 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=50317&action=edit
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 & std'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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libstdc++/99430] std::filesystem::path: UNC device paths with \\?\… not supported properly
  2021-03-06 16:11 [Bug libstdc++/99430] New: std::filesystem::path: UNC device paths with \\?\… not supported properly moritz at bunkus dot org
@ 2021-03-07 16:33 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2021-03-07 16:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99430

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
They're simply not supported at all.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-07 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-06 16:11 [Bug libstdc++/99430] New: std::filesystem::path: UNC device paths with \\?\… not supported properly moritz at bunkus dot org
2021-03-07 16:33 ` [Bug libstdc++/99430] " redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).