Re: winnt win32process.createProcess with stdout to file ?

From: Roger Upole (rupole_at_hotmail.com)
Date: 03/04/05


Date: Fri, 4 Mar 2005 16:22:21 -0500

TerminateProcess doesn't give it a chance to exit normally
and do any cleanup that would happen if it exited itself.
It may not have been able to flush its file buffers, etc.
Does the executable have any way to signal it to exit ?

         Roger

<david.humpherys@gmail.com> wrote in message
news:1109956683.854381.73600@l41g2000cwc.googlegroups.com...
> Aweseome! Many many thanks Roger ! You've made my day.
>
> The last thing that you may be able to help with...
> I'm using
> win32api.TerminateProcess(hProcess,3)
> to kill this process if it gets outta hand...
> but when i do so.. it seems that the stdout/stderr don't capture the
> output.
>
> here's my last chunk of code.
> again.. thank you so much.
>
> hProcess, hThread, dwProcessId, dwThreadId =
> win32process.CreateProcess \
> ( None, self.RENDER_STRING, sa, sa, 1,
> win32con.NORMAL_PRIORITY_CLASS, None, None, startInfo)
>
> while self.exitCode == 259:
> if self.stop:
> print "kill da process"
> win32api.TerminateProcess(hProcess,3)
>
> self.exitCode = win32process.GetExitCodeProcess(hProcess)
> time.sleep(2)
>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---



Relevant Pages

  • Re: Trapping TaskManagers kill process on win32
    ... >> the TerminateProcess() function, which can't be trapped. ... Imagine if you did this: ... What if I want the process to try to do some cleanup before ... Now if the cleanup is hosed, obviously I'd expect a kill -9 ...
    (comp.lang.ruby)
  • Re: Closing Process
    ... The recommended method is to start by giving it a chance to shut down ... gracefully and cleanup after itself by posting a WM_CLOSE message to ...
    (microsoft.public.vb.winapi)
  • Re: folder recovery?
    ... modify the disk without giving me a chance to reject the "chkdsk" ... cleanup. ... leaving no chance to stop it. ... I only recently started using win2000 (over win98se), ...
    (microsoft.public.win2000.file_system)
  • Re: Access importing csv file hangs/freezes - sample code
    ... If it was in VBA, I'd be very inclined to put some "DoEvents" in, to give the ... db or Windows a chance to cleanup. ...
    (microsoft.public.access.devtoolkits)
  • Re: Memory mapping and process termination
    ... Unlikely in the extreme. ... Not much you can do in the event of TerminateProcess. ... cleanup to ensure correct object references, ...
    (microsoft.public.win32.programmer.kernel)