Windows equivalent to “/dev/stdin”?

前端 未结 3 1930
天命终不由人
天命终不由人 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条回答
  • I may be misinterpreting your question - you know about cin and stdin, right? If you need a real live winapi handle for ReadFile or whatever, use GetStdHandle(STD_INPUT_HANDLE)

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-11 16:35

    The equivalent pseudo files on Windows are conIN$ and conOUT$.

    0 讨论(0)
提交回复
热议问题