Skip to content

path/filepath: EvalSymlinks(".") and EvalSymlinks("C:.") return different output on Windows #16886

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

Closed
hirochachacha opened this issue Aug 26, 2016 · 3 comments
Milestone

Comments

@hirochachacha
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6.3 windows/amd64
  2. What operating system and processor architecture are you using (go env)?
    set GOARCH=amd64
    set GOBIN=
    set GOEXE=.exe
    set GOHOSTARCH=amd64
    set GOHOSTOS=windows
    set GOOS=windows
    set GOPATH=C:\Users\Hiroshi\go
    set GORACE=
    set GOROOT=C:\Go
    set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
    set GO15VENDOREXPERIMENT=1
    set CC=gcc
    set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
    set CXX=g++
    set CGO_ENABLED=1
  3. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.
package main

import (
        "fmt"
        "os"
        "path/filepath"
)

func main() {
        err := os.Symlink(`../..`, "link")
        if err != nil {
                panic(err)
        }

        err = os.Chdir("link")
        if err != nil {
                panic(err)
        }

        path, err := filepath.EvalSymlinks(".")
        if err != nil {
                panic(err)
        }

        fmt.Printf(`EvalSymlinks(".") = %q`+"\n", path)

        path, err = filepath.EvalSymlinks("C:.")
        if err != nil {
                panic(err)
        }

        fmt.Printf(`EvalSymlinks("C:.") = %q`+"\n", path)

        err = os.Chdir("..")
        if err != nil {
                panic(err)
        }

        os.Remove("link")
}
  1. What did you expect to see?
    EvalSymlinks(".") = "."
    EvalSymlinks("C:.") = "C:."
  2. What did you see instead?
    EvalSymlinks(".") = "."
    EvalSymlinks("C:.") = "C:...."
@alexbrainman
Copy link
Member

@hirochachacha do you plan to fix this yourself?

Alex

@hirochachacha
Copy link
Contributor Author

Yes I will.

@hirochachacha hirochachacha changed the title path/filepath: EvalSymlinks(".") and EvalSymlinks("C:.") return different output. path/filepath: EvalSymlinks(".") and EvalSymlinks("C:.") return different output on Windows Aug 26, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Aug 26, 2016
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/28214 mentions this issue.

@golang golang locked and limited conversation to collaborators Sep 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants