CreateProcess / redirect output

Discussion in 'Python' started by Achim Domma, May 28, 2004.

  1. Achim Domma

    Achim Domma Guest

    Hi,

    I try to start a process on windows using win32process.CreateProcess and
    want to to redirect the output. I set the STARTF_USESTDHANDLES flag in the
    STARTUPINFO structure. But I can not figure out, how to get the pipes
    working. My app either deadlocks or displays the error messag:

    ....
    print win32file.ReadFile(readStdOut,10)
    pywintypes.error: (109, 'ReadFile', 'The pipe has been ended.')

    I think I'm not the only one which needs to get the output of an external
    process on windows. Is there a simpler solutions or has somebody a working
    example to share?

    regards,
    Achim
     
    Achim Domma, May 28, 2004
    #1
    1. Advertising

  2. Richie Hindle, May 28, 2004
    #2
    1. Advertising

  3. Achim Domma

    Achim Domma Guest

    "Richie Hindle" <> wrote in message
    news:...

    > Unless you have a specific reason for using CreateProcess, you can use
    > os.popen*() - see http://www.python.org/doc/current/lib/os-newstreams.html


    The code is part of a COM object which is used in an ASP page. Using popen I
    get the following error:

    [Errno 5] Access is denied: 'C:\\WINDOWS\\system32\\cmd.exe /c
    path_to\\ExtractingDummy.exe "path_to\\some_dummy.doc"'

    The IUSER has the required rights on all these files. Don't know how to
    solve that.

    > If you really do need to use CreateProcess, this might help:
    >

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/bas
    e/creating_a_child_process_with_redirected_input_and_output.asp

    That looks like the info I was looking for. Thanks!

    Achim
     
    Achim Domma, May 28, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kroum Grigorov
    Replies:
    1
    Views:
    712
    Christopher Benson-Manica
    Apr 26, 2004
  2. Elly Sokol

    CreateProcess

    Elly Sokol, Jun 17, 2004, in forum: C++
    Replies:
    13
    Views:
    4,444
    Frederic Banaszak
    Jun 18, 2004
  3. Baskar

    Createprocess

    Baskar, Jan 20, 2005, in forum: C++
    Replies:
    1
    Views:
    462
    Victor Bazarov
    Jan 20, 2005
  4. Replies:
    1
    Views:
    3,758
    Roland de Ruiter
    Jun 28, 2006
  5. Replies:
    6
    Views:
    4,772
    Roger Upole
    Mar 4, 2005
Loading...

Share This Page