[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: What's the 'portable' way to do this?

ara.t.howard

4/18/2008 4:59:00 AM


On Apr 17, 2008, at 9:30 PM, Xie Hanjian wrote:
> STDIN.reopen('/dev/tty')


stdin = STDIN.dup

data = STDIN.read

STDIN.reopen stdin


a @ http://codeforp...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




1 Answer

ara.t.howard

4/18/2008 4:02:00 PM

0


On Apr 18, 2008, at 1:51 AM, Xie Hanjian wrote:
> Thanks for your reply, but this seems not work.
>
> I think the problem is when you do STDIN.dup, you're duplicating the
> already redirected STDIN.
>
>

yeah, you'll need to start out with a tty - maybe taking in the input
file as an argument or option.

a @ http://codeforp...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama