[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Piping to windows command line .rb file doesn't work

Mills Thomas (app1tam)

10/14/2003 6:06:00 PM

If I do this:

home> type cat.rb

I get this output:

print $stdin.readlines

If I do this:

home> type cat.rb | ruby -e "print $stdin.readlines"

I get this output (NOTE, it's the same):

print $stdin.readlines

If I type this command (.rb has been associated to ruby.exe on Win2K):

home> type cat.rb | cat.rb

I get this output:

cat.rb:1:in `readlines': Bad file descriptor (Errno::EBADF)
from cat.rb:1

Any ideas why this doesn't work?

Drew

1 Answer

nobu.nokada

10/15/2003 1:03:00 AM

0

Hi,

At Wed, 15 Oct 2003 03:05:44 +0900,
Mills Thomas (app1tam) wrote:
> If I type this command (.rb has been associated to ruby.exe on Win2K):
>
> home> type cat.rb | cat.rb
>
> I get this output:
>
> cat.rb:1:in `readlines': Bad file descriptor (Errno::EBADF)
> from cat.rb:1

It's a known feature (or bug) of cmd.exe. You'd better claim
to the vender rather than to us. We can do nothing about it at
all.

--
Nobu Nakada