From: greg Date: 2006-09-28T13:54:17+09:00 Subject: Re: how to determine if pipe is given I guess the problem comes down to: can I determine if there is data being piped or if there is data waiting on STDIN before reading. I am really trying to avoid hanging from doing ARGF.readlines (or something similiar) if there is no data being piped. If a file is given as an argument it will show up in ARGV, and we know it is there, and can act accordingly. Is there any way we can know that piped data is there? I avoid at all costs writing a program that will hang under any conditions. For me, a program should always fail gracefully, it should not lose control. If it is invoked incorrectly, there should be a message explaining how to invoke it correctly, it should not just hang.