"Jean-Baptiste" <temuphaey0 / jetable.net> schrieb im Newsbeitrag
news:3fe187d2$0$7163$626a54ce / news.free.fr...
> 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.)

I guess that's the problem.  AFAIK there are some troubles with Windows
pipes...

    robert