0

Based on the Ruby documentation, both backticks and system() have the same blocking behavior (that is, they are both blocking calls).

When I use them to execute a call to xdg-open though (which in itself, forks the system process, for example libreoffice and exits), backticks blocks while the system process is executing, while system() blocks only during the system process invocation.

This is a trivial example:

`xdg-open myspreadsheet.ods`        # will block until exiting libreoffice
system 'xdg-open myspreadsheet.ods' # will block until libreoffice is invoked
Marcus
  • 5,104
  • 2
  • 28
  • 24
  • Probably relevant https://stackoverflow.com/questions/6338908/ruby-difference-between-exec-system-and-x-or-backticks – Josh Brody Dec 23 '17 at 19:43
  • That question doesn't unfortunately mention the difference, blocking-wise, between the two (it's only stated that both are blocking). – Marcus Dec 24 '17 at 21:05

0 Answers0