1

我正在寻找一种快速方法来检查哪些数据进入命名管道(在 Windows 上)。有什么办法可以从 cmd.exe 或 powershell 或 python 中做到这一点?实际上,我只找到了创建命名管道而不是操纵它的方法。但是如何打开由另一个程序创建的命名管道?

4

2 回答 2

3

Powershell 允许您使用整个 .net api,因此您可以使用框架中的管道功能

于 2012-08-24T13:29:01.423 回答
0

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.

于 2012-08-24T13:48:30.133 回答