kill_pid: kill (i.e.: stop) running processes by there pid

View source: R/kill_pid.R

kill_pidR Documentation

kill (i.e.: stop) running processes by there pid

Description

kill (i.e.: stop) running processes by there pid. It spawns a new Rscript which runs pskill on the pid-s

Usage

kill_pid(pid, s = 0, m = 0, h = 0, ...)

Arguments

pid

an integer vector with process id numbers (i.e.: can kill several pid at once!)

s

numeric. number of seconds to wait before killing the processes

m

numeric. number of minutes to wait before killing the processes

h

numeric. number of hours to wait before killing the processes

...

not used.

Value

output from system

References

tasklist details from microsoft homepage: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb491010(v=technet.10) pskill details from microsoft homepage: https://learn.microsoft.com/en-us/sysinternals/downloads/pskill

See Also

get_tasklist, get_Rscript_PID, get_pid, kill_pid, kill_all_Rscript_s, pskill

Examples

## Not run: 
# create several running processes of Rscript (to shitdown)
system("Rscript -e repeat{2+2}", wait = FALSE) # this process should be stuck   
system("Rscript -e repeat{2+2}", wait = FALSE) # this process should be stuck   
# here are there pid numbers:
get_Rscript_PID() 
# let's kill them:
kill_pid(get_Rscript_PID())
# they are gone...
get_Rscript_PID() # we no longer have Rscripts running

## End(Not run)

installr documentation built on Nov. 13, 2022, 1:06 a.m.