Skip to content

path/filepath: join function does not allow UNC for pipe #23467

@kayila

Description

@kayila

The path has to start with \\.\pipe\ for named pipes on Windows, but filepath.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)?

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"

What did you do?

package main

import (
	"fmt"
	"path/filepath"
)

func main() {
	fmt.Println(filepath.Join("\\\\.", "pipe", "blah"))
	fmt.Println(filepath.Join("\\\\.\\pipe", "blah"))
}

What did you expect to see?

\\.\pipe\blah
\\.\pipe\blah

What did you see instead?

\pipe\blah
\pipe\blah

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.OS-Windows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions