At 6:28 PM -0400 9/18/04, Ben Boulanger wrote:
Hi everyone,
        I'm having a hard time locating the solution to what I hope is a
common/simple problem.  I'm trying to run a very lengthy process, stop it
about 60 seconds in and retain whatever output has been received at that
point.  The process is samba-tng's rpcclient pulling back the eventlog of
a windows NT system.  I've tried an eval, and for some reason it's not
timing that out.  Anyone have any ideas?

My bet is you've got a version of perl that's built with safe signals. If so, you're hosed -- signal delivery to your perl program will be blocked until the child process exits. For that you'll need Plan B, which likely involves spawning off the process to run asynchronously and poll for its completion or the timeout, and collect whatever data it's emitted. Since this looks to be Unix I expect you can do a select on the filehandle to see if there's data to be read from it, then read it with sysread in nonblocking mode or something like that. I expect someone (like, say, uri) could fill you in on the gory details.
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to