N
nkammah
Hi all,
I'd like to check if a specific process with a given pid exists. I went
through the archives of the mailing list and I found a message dated in
2001, with this piece of code :
Process p = Runtime.getRuntime().exec("/bin/kill -0 " + pid);
p.waitFor();
boolean alive = p.exitValue() == 0;
I tried it, but I get an IOException :
java.io.IOException: CreateProcess: \bin\kill -0 3828 error=3
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at ProcessExistence.Check.check(Check.java:10)
at ProcessExistence.Check.main(Check.java:37)
I am using windows XP.
Any idea?
Thank you !
N.
I'd like to check if a specific process with a given pid exists. I went
through the archives of the mailing list and I found a message dated in
2001, with this piece of code :
Process p = Runtime.getRuntime().exec("/bin/kill -0 " + pid);
p.waitFor();
boolean alive = p.exitValue() == 0;
I tried it, but I get an IOException :
java.io.IOException: CreateProcess: \bin\kill -0 3828 error=3
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at ProcessExistence.Check.check(Check.java:10)
at ProcessExistence.Check.main(Check.java:37)
I am using windows XP.
Any idea?
Thank you !
N.