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.



  • Windows: only use CREATE_BREAKAWAY_FROM_JOB if the process has the permission to do so. This fixes permission errors in certain restricted environments.
  • Windows: enable JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE to kill orphaned children
  • Windows: enable JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK to allow for nested jobs


  • Windows: run programs through utils::shortPathName()
  • New function as_text() for parsing raw vectors into text
  • Skip a unit test if the 'whoami' program is not available


  • Major cleanup: moved all of the unix specific functions into the unix package
  • The 'sys' package now only focuses on executing shell commands
  • Removed configure script, no longer needed
  • Windows: fix error message when running non-existing command
  • Fix support for callback functions as std_out / std_err as documented


  • Windows: fix bug introduced in 2.0 when std_out = FALSE
  • Support std_in = FALSE to restore old behavior of an unreadable stdin (for rtika)
  • Use fcntl instead of dup2() on unix


  • Breaking change on Windows: the exec functions now automatically convert filepaths to shortpath and quote arguments when needed. Therefore the caller should not shQuote() arguments, because then they will be quoted twice. This makes Windows behavior more consistent with Unix.
  • Windows: switch to wchar_t filepaths and args for better UTF-8 support
  • Exec functions have gained a std_in file argument
  • Add wrappers r_wait() r_internal() and r_background() for convenience
  • No longer enforce the libapparmor-dev dependency on Debian/Ubuntu.


  • 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.


3.4 by Jeroen Ooms, a year 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 unix, spelling, testthat

Imported by RxODE, antiword, askpass, credentials, gert, maketools, multilinguer, neo4jshell, opencpu, outsider.base, phylocomr, plinkQC, redist, rgnparser, telemac, unrtf.

Depended on by docknitr.

Suggested by RestRserve, redux, resourcer, sen2r, ssh.

See at CRAN