in reply to blocking, non-blocking, and semi-blocking
Actually, the original uses a select timeout of zero, because I'm also waiting for IM commands to come in, so I do a nonblocking poll and then a timed wait on the IM stuff (it doesn't expose file descriptors to select on).# Recent changes log my $RC_FILE = "$TOPDIR/wikidb/rclog"; open(TAIL, "tail -f -n 0 $RC_FILE |"); my $rin = ''; vec($rin, fileno(TAIL), 1) = 1; while (1) { # Check for file input select(my $rout = $rin, undef, undef, undef); if (vec($rout, fileno(TAIL), 1)) { ...; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: blocking, non-blocking, and semi-blocking
by genecutl (Beadle) on Aug 30, 2004 at 15:18 UTC | |
by genecutl (Beadle) on Aug 30, 2004 at 16:06 UTC | |
by sfink (Deacon) on Aug 31, 2004 at 04:32 UTC | |
by genecutl (Beadle) on Sep 01, 2004 at 01:55 UTC |