1

I have a script that I need to translate from unix to windows. The script uses the 'os.mkfifo()' method to create a named pipe. This function is not available under windows. I have found the 'os.pipe()' method, but it doesn't allow to specify a name. The win32pipe api should do the right thing, but all examples I have found seem needlessly complicated. Is there anything that serves as a good alternative to the 'mkfifo' method under windows?

edit: To clarify the use case. I am creating two pipes in the script.

os.mkfifo('/path/to/sendpipe')
os.mkfifo('/path/to/receivepipe')

Another java script accesses these pipes to communicate, which is why I need an explicit file name rather than a pipe ID (which I would get from 'os.pipe()').

iHnR
  • 125
  • 7
  • It might help if you provided a simple example that showed how you are currently using `os.mkfifo`. – ekhumoro Nov 15 '20 at 13:32
  • Do you have the option of not using named pipes? I had some code that used Unix sockets (which like named pipes are exposed on the filesystem), and it ran into issues due to security issues on a particular container platform, so I just rewrote it to use local TCP sockets instead. – larsks Nov 15 '20 at 13:58
  • I'm currently getting around the problem by just using text files. It works but it's not ideal – iHnR Nov 15 '20 at 14:45
  • @panjaap Did you see [this question](https://stackoverflow.com/q/48542644/984421)? – ekhumoro Nov 15 '20 at 17:32

0 Answers0