FileUtils.copy_stream を nonblocking な IO に対して使うと、次のように
EAGAIN で例外になるようです。これは意図された挙動でしょうか?

% (sleep 1; echo a)| ruby -rfileutils -rio/nonblock -e '
STDIN.nonblock = true 
FileUtils.copy_stream(STDIN, STDOUT)'               
/home/akr/ruby/lib/ruby/1.9/fileutils.rb:446:in `sysread': Resource temporarily unavailable - <STDIN> (Errno::EAGAIN)
        from /home/akr/ruby/lib/ruby/1.9/fileutils.rb:446:in `fu_copy_stream0'
        from /home/akr/ruby/lib/ruby/1.9/fileutils.rb:440:in `copy_stream'
        from -e:3
zsh: broken pipe  (; sleep 1; echo a; ) | 
zsh: exit 1       ruby -rfileutils -rio/nonblock -e 
% seq 10000| ruby -rfileutils -rio/nonblock -e '        
STDOUT.nonblock = true
FileUtils.copy_stream(STDIN, STDOUT)'|(sleep 1; cat)
/home/akr/ruby/lib/ruby/1.9/fileutils.rb:446:in `syswrite': Resource temporarily unavailable - <STDOUT> (Errno::EAGAIN)
        from /home/akr/ruby/lib/ruby/1.9/fileutils.rb:446:in `fu_copy_stream0'
        from /home/akr/ruby/lib/ruby/1.9/fileutils.rb:440:in `copy_stream'
        from -e:3
1
2
...
1039
1040
104zsh: broken pipe  seq 10000 | 
zsh: exit 1       ruby -rfileutils -rio/nonblock -e  | 
zsh: done         (; sleep 1; cat; )
-- 
[田中 哲][たなか あきら][Tanaka Akira]