checkSystemResult: Check System Command Result for Exit Code

View source: R/rsynccli.R

checkSystemResultR Documentation

Check System Command Result for Exit Code

Description

Evaluates the result from R's system() function and checks for a non-zero exit status. If the system command failed (i.e., returned a non-zero exit status), the function throws an error. If the result contains the command's output, it is returned.

Usage

checkSystemResult(result)

Arguments

result

The result of a system() function execution. This can be:

  • A character vector containing the command's output.

  • A numeric value representing the exit status code.

  • An object with a status attribute.

Value

  • If result is a character vector (command output) and has no status attribute, returns the output.

  • If result is numeric (exit status code), returns the status code.

  • If the command failed (non-zero exit status), the function stops with an error message.


INWTlab/rsync documentation built on Oct. 25, 2024, 3:50 a.m.