Skip to main content.
home | support | download

Back to List Archive

Re: Running programs on Windows

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Sep 28 2004 - 19:24:43 GMT
On Tue, Sep 28, 2004 at 09:41:58AM -0700, Anthony Baratta wrote:
> P.S. The test code you sent me ove the weekend didn't work. ;-( The scan 
> "locked up" at the same point each time.

Well, what about something simple like this:

Index: Filter.pm.in
===================================================================
RCS file: /cvsroot/swishe/swish-e/filters/SWISH/Filter.pm.in,v
retrieving revision 1.6
diff -u -B -r1.6 Filter.pm.in
--- Filter.pm.in        9 Mar 2004 20:13:22 -0000       1.6
+++ Filter.pm.in        28 Sep 2004 19:13:02 -0000
@@ -1113,8 +1113,11 @@
          : $self->real_fork( @_ );
 
     local $/ = undef;
+    my $output = <$fh>;
+    close $fh;
+    waitpid $self->{pid}, 0 if delete $self->{pid};
 
-    return <$fh>;
+    return $output;
 }
 

That's in run_program(), fyi.  So basically it captures the output,
closes the handle and then calls waitpid to reap the zombie.  They are
zombies on Windows, right?



-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Tue Sep 28 12:24:54 2004