safeSys | R Documentation |
This function provides the sole access point to external programs for this package.
safeSys(cmd, ..., shell = TRUE, quote = TRUE, minErrorCode = 1,
splitOutput = FALSE)
cmd |
full path to the executable file (can be a shell script, for example) |
... |
list of named or unnamed parameters to the command; if
|
shell |
logical scalar; if TRUE, invoke command using a shell; otherwise, invoke cmd directly. |
quote |
logical scalar; if TRUE (the default) and if
|
minErrorCode |
the smallest integer return value that indicates an error. Some programs (e.g. 'grep') violate the usual convention that 0 = no error, and > 0 indicates an error. Default: 1 |
splitOutput |
logical; if TRUE, output is returned as a vector with one item per line. Otherwise, the default, output is returned as a character scalar with embedded newlines. |
If the exit status of the command is non-zero, then this function
triggers an error using stop(E)
where the message E
will be a character scalar consisting of the lines written to
stderr by the command, pasted together with "\n".
Otherwise, this function returns a character scalar with liens written to stdout by the command, pasted together with "\n".
The point of internalizing errors is so that we save the intermediate files and record a full stack dump. Otherwise, the server might delete downloaded files, thinking (incorrectly) that it has processed them successfully.
character vector of the stdout stream from running
cmd
, as one long item. This will have attribute "exitCode"
giving the exit code of the command, which will be in the range
0: (minErrorCode - 1)
stdout and stderr for the command are redirected to temporary files which are deleted before this function returns.
John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.