EVOLUTION-MANAGER
Edit File: Sys.getpid.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Get the Process ID of the R Session</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Sys.getpid {base}"><tr><td>Sys.getpid {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Get the Process ID of the R Session</h2> <h3>Description</h3> <p>Get the process ID of the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> Session. It is guaranteed by the operating system that two <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> sessions running simultaneously will have different IDs, but it is possible that <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> sessions running at different times will have the same ID. </p> <h3>Usage</h3> <pre> Sys.getpid() </pre> <h3>Value</h3> <p>An integer, often between 1 and 32767 under Unix-alikes (but for example FreeBSD and macOS use IDs up to 99999) and a positive integer (up to 32767) under Windows. </p> <h3>Examples</h3> <pre> Sys.getpid() ## Show files opened from this R process if(.Platform$OS.type == "unix") ## on Unix-alikes such Linux, macOS, FreeBSD: system(paste("lsof -p", Sys.getpid())) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>