Is it possible to write data into own stdin in Linux

后端 未结 2 439
走了就别回头了
走了就别回头了 2021-02-07 20:59

I want to debug my cgi script (C++) from IDE, so I would like to create a \"debug mode\": read file from disk, push it to own stdin, set some environment variables, that corresp

2条回答
  •  无人共我
    2021-02-07 21:55

    You can't "push to own stdin", but you can redirect a file to your own stdin.

    freopen("myfile.txt","r",stdin);
    

提交回复
热议问题