| Line 1... |
Line 1... |
| 1 |
% File src/library/base/man/Sys.which.Rd
|
1 |
% File src/library/base/man/Sys.which.Rd
|
| 2 |
% Part of the R package, https://www.R-project.org
|
2 |
% Part of the R package, https://www.R-project.org
|
| 3 |
% Copyright 2007-2014 R Core Team
|
3 |
% Copyright 2007-2017 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{Sys.which}
|
6 |
\name{Sys.which}
|
| 7 |
\alias{Sys.which}
|
7 |
\alias{Sys.which}
|
| 8 |
\title{Find Full Paths to Executables}
|
8 |
\title{Find Full Paths to Executables}
|
| Line 33... |
Line 33... |
| 33 |
A character vector of the same length as \code{names}, named by
|
33 |
A character vector of the same length as \code{names}, named by
|
| 34 |
\code{names}. The elements are either the full path to the
|
34 |
\code{names}. The elements are either the full path to the
|
| 35 |
executable or some indication that no executable of that name was
|
35 |
executable or some indication that no executable of that name was
|
| 36 |
found. Typically the indication is \code{""}, but this does depend on
|
36 |
found. Typically the indication is \code{""}, but this does depend on
|
| 37 |
the OS (and the known exceptions are changed to \code{""}). Missing
|
37 |
the OS (and the known exceptions are changed to \code{""}). Missing
|
| 38 |
values in \code{names} have missing return values (as from \R 3.0.0).
|
38 |
values in \code{names} have missing return values.
|
| 39 |
|
39 |
|
| 40 |
On Windows the paths will be short paths (8+3 components, no spaces)
|
40 |
On Windows the paths will be short paths (8+3 components, no spaces)
|
| 41 |
with \code{\\} as the path delimiter.
|
41 |
with \code{\\} as the path delimiter.
|
| 42 |
}
|
42 |
}
|
| 43 |
\note{
|
43 |
\note{
|
| 44 |
Except on Windows this calls the system command \command{which}: since
|
44 |
Except on Windows this calls the system command \command{which}: since
|
| 45 |
that is not part of e.g.\sspace{}the POSIX standards, exactly what it does is
|
45 |
that is not part of e.g.\sspace{}the POSIX standards, exactly what it does is
|
| 46 |
OS-dependent. It will usually do tilde-expansion and it may make use
|
46 |
OS-dependent. It will usually do tilde-expansion and it may make use
|
| 47 |
of \command{csh} aliases.
|
47 |
of \command{csh} aliases.
|
| 48 |
|
- |
|
| 49 |
In \R 2.x.y, arguments containing spaces or other metacharacters
|
- |
|
| 50 |
needed to be escaped as they would be for a shell: for example Windows
|
- |
|
| 51 |
paths containing spaces needed to be enclosed in double quotes.
|
- |
|
| 52 |
}
|
48 |
}
|
| 53 |
\examples{
|
49 |
\examples{
|
| 54 |
## the first two are likely to exist everywhere
|
50 |
## the first two are likely to exist everywhere
|
| 55 |
## texi2dvi exists on most Unix-alikes and under MiKTeX
|
51 |
## texi2dvi exists on most Unix-alikes and under MiKTeX
|
| 56 |
Sys.which(c("ftp", "ping", "texi2dvi", "this-does-not-exist"))
|
52 |
Sys.which(c("ftp", "ping", "texi2dvi", "this-does-not-exist"))
|