equivalent of Java's getErrorStream in C++ - need to capture standard error

Discussion in 'C++' started by vj, May 21, 2004.

  1. vj

    vj Guest

    I need to capture the error code put out by an executable which I run
    from my program using

    rc = system(command);

    I get the stdout into rc. But how do I get to stderr ?
    ( command does cerr << errorcode; as part of its execution)

    Can this be done without creating a file ?

    Thanks in advance for your help.
     
    vj, May 21, 2004
    #1
    1. Advertising

  2. Re: equivalent of Java's getErrorStream in C++ - need to capturestandard error

    vj wrote:
    > I need to capture the error code put out by an executable which I run
    > from my program using
    >
    > rc = system(command);
    >
    > I get the stdout into rc. But how do I get to stderr ?


    There is no way to do that in C++.

    > ( command does cerr << errorcode; as part of its execution)
    >
    > Can this be done without creating a file ?


    Yes, by using OS-specific means, like opening a pipe instead of using
    'system', etc. Off-topic here, ask in a newsgroup for your OS.

    Victor
     
    Victor Bazarov, May 21, 2004
    #2
    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. Zsolt Koppany
    Replies:
    2
    Views:
    7,190
    SaintMagoo
    Mar 5, 2011
  2. P.Hill
    Replies:
    0
    Views:
    666
    P.Hill
    Nov 19, 2003
  3. Max
    Replies:
    7
    Views:
    9,157
  4. Venks
    Replies:
    5
    Views:
    249
    Ken Bloom
    Dec 6, 2007
  5. Anil Gollaa
    Replies:
    1
    Views:
    140
    Daniel Berger
    Jun 18, 2009
Loading...

Share This Page