-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Unreachable code reached when using UNC paths on Windows #8205
Copy link
Copy link
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsMicrosoft Windowsstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsMicrosoft Windowsstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Using absolute paths related to network shares (starting with
\\...) will result in stdlib reachingunreachable, meaning it's impossible to recover from. Preferred would be if it spat an error such aserror.UnsupportedDriveso it can be handled gracefully, or if support for them was added.Note that getting the working dir handle from
std.fs.cwd()whilst on a network share works, and you can useopenDir,openFile, and all other relative methods from there. Meaning if you've somehow gotten a handle, you can access and read/write files. Afaik it only breaks when you try to use absolute paths.Getting working dir from
std.fs.cwd()whilst on a network share and then runningrealpathon the handle also breaks withunreachable.I've only experienced this because I've done development in WSL2, which Windows has mounted as a network share.
Example:
Output: