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
The path has to start with \\.\pipe\ for named pipes on Windows, but filepath.Join() removes the leading \\..
\\.\pipe\
filepath.Join()
\\.
go version
1.9.1
Yes. (1.9.2, as of opening this issue.)
go env
GOARCH="amd64" GOBIN="" GOEXE=".exe" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="windows" GOPATH="/home/kayila/go" GORACE="" GOROOT="/usr/lib/go-1.7" GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_amd64" CC="gcc" GOGCCFLAGS="-m64 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build187455838=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="0"
package main import ( "fmt" "path/filepath" ) func main() { fmt.Println(filepath.Join("\\\\.", "pipe", "blah")) fmt.Println(filepath.Join("\\\\.\\pipe", "blah")) }
\\.\pipe\blah \\.\pipe\blah
\pipe\blah \pipe\blah
The text was updated successfully, but these errors were encountered:
If you know, that a named pipe on Windows has a special prefix that intentionally does comply with filepath.Clean rules, just use
filepath.Clean
`\\.\` + filepath.Join("pipe", "blah")
ie. don't pass the special prefix to filepath.Join that's documented to Clean the result.
filepath.Join
Clean
Sorry, something went wrong.
@kayila yes path/filepath package does not support pipe names. But it also does not support paths starting with \\?\ either (which are more common).
\\?\
https://golang.org/doc/contribute.html if you decide to add missing functionality.
Alex
No branches or pull requests
The path has to start with
\\.\pipe\
for named pipes on Windows, butfilepath.Join()
removes the leading\\.
.What version of Go are you using (
go version
)?1.9.1
Does this issue reproduce with the latest release?
Yes. (1.9.2, as of opening this issue.)
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: