Skip to content

path/filepath: Glob inconstent behavior on Windows beginning in 1.6 #14949

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
copperfishgh opened this issue Mar 24, 2016 · 4 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@copperfishgh
Copy link

Works correctly and consistently on go 1.4, 1.5.
Works inconsistently in go 1.6. It behaves differently based on the current directory where the program is executed. If run from the C: drive, fails by not matching and returns an empty list. If run from the E: drive, the exact same binary works and returns 2 matches.

Tested on Windows 2008 R2

Problem description: Using the following glob logic to detect the installation of Git on 32 or 64 bit windows machines. Expect back a list paths of potential 'git.exe' that someone might be using. However, when compiled with 1.6, does not work.

package main

import (
"fmt"
"path/filepath"
)

func main() {
matches, err := filepath.Glob(C:\Program Files*\*\bin\git.exe)
if err != nil {
fmt.Println("err=", err)
}
fmt.Println(matches)
}

@ianlancetaylor ianlancetaylor changed the title filepath.Glob inconstent behavior beginning in 1.6 path/filepath: Glob inconstent behavior on Windows beginning in 1.6 Mar 24, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 24, 2016
@mattn
Copy link
Member

mattn commented Mar 25, 2016

@gopherbot
Copy link
Contributor

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

@rsc
Copy link
Contributor

rsc commented May 18, 2016

There's a CL pending here and it seems important to get in. This was exposed by the change to filepath.Join.

@gopherbot
Copy link
Contributor

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

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label May 26, 2016
@golang golang locked and limited conversation to collaborators May 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
Development

No branches or pull requests

6 participants