-
Notifications
You must be signed in to change notification settings - Fork 1
/
Sys.which.html
73 lines (48 loc) · 2.16 KB
/
Sys.which.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><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"><tr><td>Sys.which</td><td 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>.
</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 of possible executables.</p>
</td></tr>
</table>
<h3>Details</h3>
<p>The system command <code>which</code> reports on the full names of an
executable (including an executable script) found on the current 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>system</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 <font face="Courier New,Courier" color="#666666"><b>R</b></font> is installed and (currently)
stored in environment variable <code>WHICH</code>.
</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>).
</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>
</body></html>