3

You could get your users to install the pipelist utility, and then process the output of:

subprocess.check_output("pipelist", universal_newlines=True)

Using C#, one can also do something like this:

String[] listOfPipes = System.IO.Directory.GetFiles(@"\\.\pipe\");

Is there a way to replicate this C# solution using pywin32/win32api?

Alex K.
  • 171,639
  • 30
  • 264
  • 288
bzm3r
  • 3,113
  • 6
  • 34
  • 67

1 Answers1

5

As noted in comment

import os
arr = os.listdir('\\\\.\\pipe')
print (arr)
Barmak Shemirani
  • 30,904
  • 6
  • 40
  • 77
  • "\Device\NamedPipe" is a filesystem, implemented by the filesystem driver "\FileSystem\Npfs". It's not a complete filesystem, though. It doesn't implement all system calls that are expected of a filesystem. But it does implement `NtQueryDirectoryFile`, so it can be used with WinAPI `FindFirstFile`, etc. – Eryk Sun Jan 23 '18 at 01:40