kill a process started with popen

前端 未结 8 1363
温柔的废话
温柔的废话 2020-12-04 15:04

After opening a pipe to a process with popen, is there a way to kill the process that has been started? (Using pclose is not what I want because th

8条回答
  •  忘掉有多难
    2020-12-04 15:27

    I simply put in the (bash) script, in the first line:

    echo PID $$
    

    then I read the pid, and use it to do a : kill(pid,9)

提交回复
热议问题