From: Jean-Baptiste Date: 2003-12-18T19:57:08+09:00 Subject: question about I/O and pipes There is a (very) little programm (count.rb) which count lines: cnt = 0 $stdin.each_line {|line| cnt = cnt + 1 } print cnt,"\n" Now I want to use it whith pipes like this: dir | count but i got this error C:\ruby>dir | count C:/ruby/count.rb:3:in `each_line': Bad file descriptor (Errno::EBADF) from Z:/ruby/count.rb:3 What is the problem? (NB: I an working on Windows2000.) Thanks