Skip to content

os: Windows named pipes are listed as regular by Stat #41755

@secDre4mer

Description

@secDre4mer

What version of Go are you using (go version)?

$ go version
go version go1.15.2 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Max\AppData\Local\go-build
set GOENV=C:\Users\Max\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Max\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Max\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Max\AppData\Local\Temp\go-build300293506=/tmp/go-build -gno-record-gcc-switches

The underlying OS is Windows 10, version 2004.

What did you do?

I ran os.Stat, passing an existing pipe as an example. Source code for this can be found at https://play.golang.org/p/a1O5axVpLOO
In this example, the Pipe is created in the Golang program, but the issue is also reproducible when using a different, existing pipe.

What did you expect to see?

The FileInfo should have ModeNamedPipe set.

What did you see instead?

The FileInfo had no ModeNamedPipe set and was listed as a regular file.
Output from the example code:

$ go run .
0
438
true

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windowshelp wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions