in reply to Re^8: Please suggest a non-forking way to do this (OS: windows)
in thread Please suggest a non-forking way to do this (OS: windows)
Not quite.
use strict; use warnings; use Fcntl qw( F_SETFL O_NONBLOCK ); my $fh = \*STDIN; fcntl($fh, F_SETFL, O_NONBLOCK) || die "$!\n"; sysread($fh, my $buf, 1);
Your vendor has not defined Fcntl macro F_SETFL, used at ...
Similarly, $fh->blocking(0); is a no-op.
Like I said earlier, as far as I know, it's impossible to detect whether the pipe has data waiting.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Please suggest a non-forking way to do this (OS: windows)
by BrowserUk (Patriarch) on Sep 30, 2008 at 15:19 UTC | |
by ikegami (Patriarch) on Sep 30, 2008 at 15:57 UTC | |
by BrowserUk (Patriarch) on Sep 30, 2008 at 16:26 UTC | |
by ikegami (Patriarch) on Sep 30, 2008 at 23:27 UTC | |
|
Re^10: Please suggest a non-forking way to do this (OS: windows)
by zentara (Cardinal) on Sep 30, 2008 at 14:35 UTC | |
by ikegami (Patriarch) on Sep 30, 2008 at 15:27 UTC | |
by zentara (Cardinal) on Sep 30, 2008 at 16:23 UTC | |
by ikegami (Patriarch) on Oct 01, 2008 at 01:58 UTC |