> From:  matz / ruby-lang.org (Yukihiro Matsumoto)
> That's different issue.  Unfortunately, IO#eof does block the current
> thread, it does not block other threads.

Whoops, sorry.  You're right.

> I'm still not sure if I
> should change (or how I should change) the IO#eof semantic, that
> inherited from Perl.
> 
>  % perl -e 'open(F, "sleep 2|"); print "a\n"; eof(F); print "b\n"'

Hm.  I feel pretty strongly that it should be a non-blocking semantic.
It seems that all it should do is return the current state of the
channel.

I'm not sure if it's relevant, but tcl supports a non-blocking check:

  % set f [open "|sleep 2"]; puts "a"; eof $f; puts "b"

as does the standard C library:

  #include <stdio.h>
  main() {
    FILE* fp = popen("sleep 2", "r"); puts("a"); (void) feof(fp); puts("b");
  }

I would claim that Perl is also buggy.

I did look briefly at the Ruby source, and I could not easily figure out
a patch to fix the behavior, unfortunately...

	Steven
	grady / xcf.berkeley.edu

"For the last time -- Big Bird is, like, HUGE!  If you tried
to eat him, he'd flatten you!"
"You don't KNOW that."