Powerful and Reliable Tools for Running System Commands in R

Drop-in replacements for the base system2() function with fine control and consistent behavior across platforms. Supports clean interruption, timeout, background tasks, and streaming STDIN / STDOUT / STDERR over binary or text connections. Arguments on Windows automatically get encoded and quoted to work on different locales. On Unix platforms the package also provides functions for evaluating expressions inside a temporary fork. Such evaluations have no side effects on the main R process, and support reliable interrupts and timeouts. This provides the basis for a sandboxing mechanism.



  • Faster serialization for raw vectors in eval_fork()


  • rlimit values 0 are now ignored and Inf means RLIM_INFINITY
  • Windows: fix crash for very long commands


  • Fix bug when 'timeout' was given as integer instead of double
  • Workaround undefined RLIMIT_AS on OpenBSD
  • Use graphics.off() instead of dev.off() to shut down all graphics devices
  • Added aa_config() to query apparmor status on supported platforms
  • On Linux, eval_fork() now kills entire child process group when parent dies
  • The exec() functions no longer change process group on OSX


  • Use AppArmor (required) on Debian/Ubuntu in eval_safe()
  • Disable console and finalizers inside forked procs
  • Add support for rlimits, priority, uid, gid and profile in eval_safe()


  • Windows: show informative system error messages on failures
  • Unix: exec_background() does not wait for 1/2 a second (#6, #7, @gaborcsardi)
  • Unix: new functions eval_fork() and eval_safe()
  • Many little tweaks


  • Switch from SIGHUP to SIGKILL to kill child process
  • Child now uses a pipe to send errno to parent when execvp() fails
  • Unit tests that require 'ping' are skipped if 'ping' is not available


  • CRAN release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2.1 by Jeroen Ooms, 3 months ago


Report a bug at https://github.com/jeroen/sys/issues

Browse source code at https://github.com/cran/sys

Authors: Jeroen Ooms [aut, cre] , Gábor Csárdi [ctb]

Documentation:   PDF Manual  

MIT + file LICENSE license

Suggests spelling, unix, testthat

System requirements: libapparmor-dev (optional, debian/ubuntu only)

Imported by antiword, askpass, metaboGSE, opencpu, phylocomr, phylotaR, plinkQC, rtika, unrtf.

Suggested by redux, ssh.

See at CRAN