EVOLUTION-MANAGER
Edit File: Sys.which.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: Find Full Paths to Executables</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.which {base}"><tr><td>Sys.which {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Find Full Paths to Executables</h2> <h3>Description</h3> <p>This is an interface to the system command <code>which</code>, or to an emulation on Windows. </p> <h3>Usage</h3> <pre> Sys.which(names) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>names</code></td> <td> <p>Character vector of names or paths of possible executables.</p> </td></tr> </table> <h3>Details</h3> <p>The system command <code>which</code> reports on the full path names of an executable (including an executable script) as would be executed by a shell, accepting either absolute paths or looking on the path. </p> <p>On Windows an ‘executable’ is a file with extension ‘<span class="file">.exe</span>’, ‘<span class="file">.com</span>’, ‘<span class="file">.cmd</span>’ or ‘<span class="file">.bat</span>’. Such files need not actually be executable, but they are what <code><a href="system.html">system</a></code> tries. </p> <p>On a Unix-alike the full path to <code>which</code> (usually ‘<span class="file">/usr/bin/which</span>’) is found when <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> is installed. </p> <h3>Value</h3> <p>A character vector of the same length as <code>names</code>, named by <code>names</code>. The elements are either the full path to the executable or some indication that no executable of that name was found. Typically the indication is <code>""</code>, but this does depend on the OS (and the known exceptions are changed to <code>""</code>). Missing values in <code>names</code> have missing return values. </p> <p>On Windows the paths will be short paths (8+3 components, no spaces) with <code>\</code> as the path delimiter. </p> <h3>Note</h3> <p>Except on Windows this calls the system command <code>which</code>: since that is not part of e.g. the POSIX standards, exactly what it does is OS-dependent. It will usually do tilde-expansion and it may make use of <code>csh</code> aliases. </p> <h3>Examples</h3> <pre> ## the first two are likely to exist everywhere ## texi2dvi exists on most Unix-alikes and under MiKTeX Sys.which(c("ftp", "ping", "texi2dvi", "this-does-not-exist")) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>