Does Perl IO :: Select on Windows work with file descriptors?

Is there an IO :: Select in Windows working with file descriptors?

$pid = open $handle, "-|", "$_command" || die "Cannot run $_command";
my $s = IO::Select->new();
$s->add($handle);
$s->add(\*STDIN);
while (1) {
    @ready = $s->can_read(30);
    if (scalar(@ready) > 0) {
    }
    else {
    }
}

My script continuously prints something on the screen, open, the command runs in the background, but can_readalways fails on Windows. Any help?

+3
source share
1 answer

See the PerlMonks stream :

select(the base system call used IO::Select) works only for sockets on Windows.

The MSDN docs for selection confirm this:

The function selectdetermines the state of one or more sockets, waiting if necessary to perform synchronous I / O.

+8

Source: https://habr.com/ru/post/1722303/


All Articles