J
Jean-Baptiste
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
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