Skip to content

Windows junction handling for Go 1.23+#176

Open
Nusiq wants to merge 1 commit intootiai10:mainfrom
Bedrock-OSS:main
Open

Windows junction handling for Go 1.23+#176
Nusiq wants to merge 1 commit intootiai10:mainfrom
Bedrock-OSS:main

Conversation

@Nusiq
Copy link
Copy Markdown

@Nusiq Nusiq commented Dec 2, 2025

Go 1.23 changed the junction handling on Windows. Junctions are no longer reported with the os.ModeSymlink bit set. Instead, they set the os.ModeIrregular.

This PR makes the the copy function correctly copy the junctions again, like it used to do before Go 1.23 instead of returning an error.

…stent behavior between Go versions before and after version 1.23.
Comment thread copy.go

switch {
case info.Mode()&os.ModeSymlink != 0:
case info.Mode()&os.ModeSymlink != 0 || info.Mode()&os.ModeIrregular != 0:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just adding another case?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, It's your code. If the junctions are handled the same way as symlinks the result is the same. I'm not sure if they require any special handling so I put it in one case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants