summaryrefslogtreecommitdiff
path: root/code/snippets/spawn_popen_no_block.rb
diff options
context:
space:
mode:
Diffstat (limited to 'code/snippets/spawn_popen_no_block.rb')
-rw-r--r--code/snippets/spawn_popen_no_block.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/code/snippets/spawn_popen_no_block.rb b/code/snippets/spawn_popen_no_block.rb
new file mode 100644
index 0000000..9cf54a0
--- /dev/null
+++ b/code/snippets/spawn_popen_no_block.rb
@@ -0,0 +1,4 @@
+# This example will return a file descriptor (IO object). Reading from it
+# will return what was printed to STDOUT from the shell command.
+IO.popen('ls')
+