Skip to content

Instantly share code, notes, and snippets.

@jtrim
Created March 8, 2012 19:15
Show Gist options
  • Select an option

  • Save jtrim/2002806 to your computer and use it in GitHub Desktop.

Select an option

Save jtrim/2002806 to your computer and use it in GitHub Desktop.
# shell
mkfifo mypipe
# ruby
open('mypipe', 'r+b'){ |f| puts f.gets(nil) }
# shell
echo "HI" > mypipe
echo "WEEE" > mypipe
# ruby never returns from `gets`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment