-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
os: could not iterate over named pipes on Windows #32423
Comments
It isn't clear to me if this is something that the standard library itself should handle, but I recently wrote some Go code to do just this if it helps: https://github.com/WireGuard/wgctrl-go/blob/master/internal/wguser/conn_windows.go#L196. |
/cc @alexbrainman |
Or sure, maybe we could fix that code. I don't have time to debug this, but, if someone is interested, maybe they could make code above work. Maybe FindFirstFile and FindNextFile could be used to read that directory. Alex |
Change https://golang.org/cl/181057 mentions this issue: |
Thanks, this solved my issue. |
I've submitted a patch that makes this work with package |
Documentation states explicitly that it is not possible to list pipes using Win 32 API. For the same reason, The same documentation suggests to use Adding the relevant call require seems more like a proposal. |
@mdlayher the code you are referring to, implements functionality to connect to Windows named pipe. What we want in this issue is to list all files under
@iwdgo using NtQueryDirectoryFile sounds like it might work. And you don't need to add NtQueryDirectoryFile to syscall package. We can put it in internal/syscall/windows if it works. Alex |
Following code can help until fixed.
|
The issue here is that Windows is not treating This behavior is weird, can't see it documented anywhere, but it is what it is. Python's We could special-case |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wanted to iterate over Windows' named pipes using
os
package:What did you expect to see?
The same result as in Python:
What did you see instead?
The text was updated successfully, but these errors were encountered: