Learn R Programming

sfsmisc (version 0.9-4)

Sys.ps: Return Process Status (unix ps) Information

Description

These functions return process id and status information, typically about the running Rprocess.

Usage

Sys.PID(ps.cmd = Sys.ps.cmd())
Sys.ps.cmd()

Sys.ps(process= Sys.getpid(), fields = c("pid", "pcpu", "time", "vsz", "comm"), usefile = length(fields) > 10, ps.cmd = Sys.ps.cmd(), verbose = getOption("verbose"), warn.multi = verbose || any(fields != "ALL"))

Sys.sizes(process = Sys.getpid(), ps.cmd = Sys.ps.cmd())

Arguments

process
the process id, an integer.
fields
character strings of "ALL", specifying which process status fields are desired.
usefile
logical; if true, system writes to a temporary file and that is scaned subsequently.
ps.cmd
character string, giving the ``ps'' command name to be used.
verbose
logical ...
warn.multi
logical ...

Value

  • Note, that Sys.sizes() currently returns two integers which are ``common'' to Solaris and Linux.

Details

Note that our Sys.PID(ps.cmd) is only left for historical reason since R1.7.0, where Sys.getpid() was introduced. It may be modified to find other process ID.

Use man ps on your respective Unix system, to see what fields are supported exactly. Unix dialects do differ here, and, SunOS-Solaris even has more than one ps command...

See Also

Sys.info, Sys.getpid, proc.time.

Examples

Run this code
(.pid <- Sys.getpid()) ## process ID of current process
Sys.sizes(.pid)

Run the code above in your browser using DataLab