Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: handle relative paths in fixLongPath on Windows #41734

Open
rsc opened this issue Oct 1, 2020 · 3 comments
Open

os: handle relative paths in fixLongPath on Windows #41734

rsc opened this issue Oct 1, 2020 · 3 comments
Labels
Milestone

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Oct 1, 2020

The os package has a function fixLongPath that is used on Windows to turn a very long name like c:\very\long\name.txt to \\?\c:\very\long\name.txt.

This function bails out on relative path names. It also bails out on paths containing ...

This has caused no end of problems and confusion with certain APIs that do or don't accept certain paths.

We should fix fixLongPath to correctly handle all possible inputs and eliminate all those problems.

@networkimprov
Copy link

@networkimprov networkimprov commented Oct 1, 2020

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 19, 2020

Change https://golang.org/cl/263538 mentions this issue: os: on Windows, implement fixLongPath also for relative paths

@networkimprov
Copy link

@networkimprov networkimprov commented Oct 19, 2020

@rasky I think fixLongPath() will need to return an error since syscall.FullPath() can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.