You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd c:\repro-realpath-bug
node
> fs.realpathSync("./src/index.js")
'c:\\repro-realpath-bug\\src\\index.js'
> fs.realpathSync("./link/index.js")
'C:\\repro-realpath-bug\\src\\index.js'
Notice the link drive letter is capitalized (as the junction target drive letter is capitalized) but targeting the file directly gives us a lowercased drive letter (that matches the cd command target).
If you do cd C:\repro-realpath-bug however, they will match.
What is the expected behavior?
Regardless of the path to get to the real file, the drive letter casing matches what is in process.cwd(), like when following a relative path.
What do you see instead?
When following a junction, the path casing changes to whatever the junction target uses
Additional information
Note that this bug works the other way too, if you create the junction with a lowercase drive letter
This has been stale for a long time. Based on the investigation, the main reason for the inconsistency is the DeviceIOControl Windows API call, more precisely the values it returns. Because of all of this, I'm closing the issue. Feel free to reopen if needed.
What steps will reproduce the bug?
Create a small repro directory that contains a junction from one folder to another and create a simple source file:
Now enter the directory and try using realpath:
Notice the link drive letter is capitalized (as the junction target drive letter is capitalized) but targeting the file directly gives us a lowercased drive letter (that matches the cd command target).
If you do
cd C:\repro-realpath-bug
however, they will match.What is the expected behavior?
Regardless of the path to get to the real file, the drive letter casing matches what is in process.cwd(), like when following a relative path.
What do you see instead?
When following a junction, the path casing changes to whatever the junction target uses
Additional information
Note that this bug works the other way too, if you create the junction with a lowercase drive letter
The text was updated successfully, but these errors were encountered: