From: Xie Hanjian Date: 2008-04-18T12:30:46+09:00 Subject: What's the 'portable' way to do this? --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I want to know if there's a more 'portable' way to do this in ruby: I hope my programe will accept data from redirected stdin or pipe, like cat bar | foo.rb foo.rb < bar And after read the data I want to interact with the foo.rb in console.=20 The problem is stdin has been redirected so I have to: STDIN.reopen('/dev/tty') Hardcoding a string in the script seems not good. Any suggestions? Thanks Jan --=20 jan=3Dcallcc{|jan|jan};jan.call(jan) --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iEYEARECAAYFAkgIFV0ACgkQrEeD7Z87FjoldQCgrpGZKnQTVqii/K/s0Txno45K 9VkAn3quzcR4/Asml2+6I3BO1EQLud6h =CVjT -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--