Windows equivalent to “/dev/stdin”?

前端 未结 3 1929
天命终不由人
天命终不由人 2021-01-11 16:04

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 sp

3条回答
  •  长发绾君心
    2021-01-11 16:35

    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.

提交回复
热议问题