redirecting a child process output to a file

Bill Ives wei at hpctdls.HP.COM
Thu Aug 3 23:42:19 AEST 1989



    The reason your redirection technic does not work is because
    the '>' operator is a DOS command shell ( among other shells )
    operator... Thus, your command works at the command prompt because
    command.com parses it out and sets up the redirection before
    starting the process ... As it stands now, your spawn command will
    pass the > charater as a command line parameter to the process which
    could look for it-- bad way to do this though.  To do this without
    the shell you will have to set up redirection yourself -- look up
    Dos Dup Handle and Dos Close Handle for information about this...
    If you have access to older ket notes this technic has been covered
    in excessive detail-- I have covered it at least three times myself.
    Email me if you can't figure it out and I'll send you an example..
 
    Bill Ives
    HP CTD

    #include <std-disclaimer> /* I could never speak for HP */



More information about the Comp.lang.c mailing list