I'm looking for a quick way to check which data comes into a named pipe (on windows). Is there any way to do it from cmd.exe or powershell or python? Actually I found only ways to create named pipe and than manipulate it. But how can I open a named pipe created by another program?
2 Answers
Powershell allows you to use the entire .net api as such you can use the pipe function in the framework.
Comments
The client can connect to a Windows named pipe as if it was any other file, provided it has been created by another program. The low-level API is CreateFile using ALWAYS_EXISTING, but the ordinary language routines, like Python's open should work. The filename will be \\ server \pipe\ name.
Unlike disk files pipes are temporary, and when every handle to a pipe has been closed, the pipe and all the data it contains are deleted, so personally I maintain the pipe using a service where necessary.