in reply to Re: How to check a executable's status while running it.
in thread How to check a executable's status while running it.

I came up withj this
#Returns the status object of the sync process $oExec; $oExec = system($stepName); $ouputStream = ""; while($? eq 0){ Do While Not oExec.StdOut.AtEndOfStream ouputStream = ouputStream & oExec.StdOut.ReadAll Loop sleep 100; } Do While Not oExec.StdOut.AtEndOfStream ouputStream = ouputStream & oExec.StdOut.ReadAll Loop #WScript.StdOut.Write ouputStream return $oExec; }
Does this look right? But system won't return the output...

Replies are listed 'Best First'.
Re^3: How to check a executable's status while running it.
by dragonchild (Archbishop) on Apr 18, 2005 at 19:28 UTC
    open( CMD, "$command |" ) or die "Cannot open $command: $!\n"; while ( defined( my $line = <CMD> ) ) { # Do stuff with $line which is the output from $command } close CMD;
    Or, ikegami has a list of number of good modules that do similar things.