Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows equivalent to "/dev/stdin"?

Tags:

windows

stdin

I have Python code talking to a C++ library which only takes filenames. I want it to read from stdin. On Unix machines I can use "/dev/stdin". I thought I could use the special "CON" device on Windows, but that's more like /dev/tty in that "echo something | my_program" does not work.

Supporting pipes under Windows isn't essential, but now I'm curious. Is there something like the filename "/dev/stdin" for that OS?

like image 576
Andrew Dalke Avatar asked Sep 12 '11 23:09

Andrew Dalke


1 Answers

To the best of my knowledge there is no equivalent of /dev/stdin. However, if you really needed to you could create your own named pipe (CreateNamedPipe) and pass the name to the C++ library, using a separate thread to feed the input from stdin into the named pipe.

like image 182
Harry Johnston Avatar answered Oct 13 '22 00:10

Harry Johnston