-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
path/filepath: filepath.Abs("[...]\\...") returns different results on Windows than other systems #42362
Comments
Why? This is how my command prompt works
I don't see why filepath should work differently. Alex |
I don't make sure but https://devblogs.microsoft.com/oldnewthing/20160202-00/?p=92953 |
I should have been more specific. The reason I'm expecting that is because that "is" what I'm getting on my Linux machine (see package main
import (
"fmt"
"path/filepath"
)
func main() {
fmt.Println(filepath.Abs("./Documents/..."))
} will output I'm not sure which approach is correct, i.e. whether "..." should be maintained by
Just to clarify, I'm trying to use the
I suppose that may explain why the behaviour is different between Windows and Unix 🤔 $ go version go version go1.15.3 linux/amd64
|
I cannot expect Linux and Windows to behave the same. See #42362 (comment) Also
Alex |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Or a play.golang.org link
What did you expect to see?
I expect the output to be
c:\windows\...
What did you see instead?
Instead I saw
c:\windows
Additional details
Based on my own quick investigation the problem seems to come from the
syscall.FullPath()
call, but within that function I wasn't able to determine why this is or how to fix it.The text was updated successfully, but these errors were encountered: