in reply to Re^6: Forks, Pipes and Exec (file descriptors)
in thread Forks, Pipes and Exec
I'll answer some of the points you brought up first so you can point out any flaws in my thinking:
From what I've read POE might have a been something to look at but I need this done sooner than later and I already have this module working in Linux... Windows is always the problem (jab). Plus I would like to get a better understanding of the inner workings of perl
The last problem I seem to be fighting is that when I run the code to set a pipe as nonblocking, it isn't really nonblocking. I seem to get a chunk of data every 15 seconds or so on Win2k3 using this code:
use IO::Handle; print "before the pipe\n"; sub getpipe { my $hash2 = shift; $hash2->{pid} = open( $hash2->{stdout}, "c:\\perl\\bin\\perl.exe ye +s.pl |") or die; $hash2->{buffer} = ""; $hash2->{stdout}->blocking(0); sleep( 3 ); return $hash2->{pid}; } my $hash = {}; getpipe($hash); my $fh = $hash->{stdout}; print( "pipe created\n" ); while( <$fh> ) { print "got from pipe: $_"; sleep( 1 ); } print( "done\n" );
while( 1 ) { printf "%s yes\n", time(); sleep( 1 ); }
got from pipe: 1226094472 yes 1226094473 yes 1226094474 yes 1226094475 yes 1226094476 yes 1226094477 yes 1226094478 yes 1226094479 yes 1226094480 yes 1226094481 yes 1226094482 yes 1226094483 yes 1226094484 yes 1226094485 yes 1226094486 yes 1226094487 yes
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Forks, Pipes and Exec (file descriptors)
by BrowserUk (Patriarch) on Nov 08, 2008 at 00:49 UTC | |
by diabelek (Beadle) on Nov 08, 2008 at 04:12 UTC | |
by BrowserUk (Patriarch) on Nov 08, 2008 at 15:12 UTC | |
by diabelek (Beadle) on Nov 12, 2008 at 04:05 UTC | |
by BrowserUk (Patriarch) on Nov 12, 2008 at 05:45 UTC | |
| |
|
Re^8: Forks, Pipes and Exec (file descriptors)
by diabelek (Beadle) on Nov 07, 2008 at 23:14 UTC |