redirecting standard error

Discussion in 'C++' started by Rob Z, Dec 2, 2004.

  1. Rob Z

    Rob Z Guest

    I use popen in C++ to grab the standard output from Unix commands. Is
    there a similarly simple and fast way to grab standard error as well?
    I understand Python has different popen commands for different
    streams, but don't know about C++.

    Thanks
     
    Rob Z, Dec 2, 2004
    #1
    1. Advertising

  2. Rob Z wrote:
    > I use popen in C++ to grab the standard output from Unix commands. Is
    > there a similarly simple and fast way to grab standard error as well?
    > I understand Python has different popen commands for different
    > streams, but don't know about C++.


    C++ doesn't have popen. It's your OS (UNIX) that does. And if Python
    can do it, there is nothing to stop your C++ program from doing it too.
    However, it's beyond the scope of this newsgroup, since it's OS-specific.
    Try comp.os.<your_os>.programmer.

    V
     
    Victor Bazarov, Dec 2, 2004
    #2
    1. Advertising

  3. Rob Z

    Default User Guest

    Victor Bazarov wrote:

    > Rob Z wrote:
    > > I use popen in C++ to grab the standard output from Unix commands.
    > > Is there a similarly simple and fast way to grab standard error as
    > > well? I understand Python has different popen commands for
    > > different streams, but don't know about C++.

    >
    > C++ doesn't have popen. It's your OS (UNIX) that does. And if Python
    > can do it, there is nothing to stop your C++ program from doing it
    > too. However, it's beyond the scope of this newsgroup, since it's
    > OS-specific. Try comp.os.<your_os>.programmer.



    Or comp.unix.programmer.



    Brian
     
    Default User, Dec 2, 2004
    #3
  4. Rob Z

    Alex Vinokur Guest

    "Rob Z" <> wrote in message news:...
    > I use popen in C++ to grab the standard output from Unix commands. Is
    > there a similarly simple and fast way to grab standard error as well?
    > I understand Python has different popen commands for different
    > streams, but don't know about C++.
    >
    > Thanks


    The response has been sent to news:comp.unix.programmer .

    --
    Alex Vinokur
    email: alex DOT vinokur AT gmail DOT com
    http://mathforum.org/library/view/10978.html
    http://sourceforge.net/users/alexvn
     
    Alex Vinokur, Dec 3, 2004
    #4
    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. Gerrit Hulleman
    Replies:
    1
    Views:
    392
    John Harrison
    Apr 29, 2004
  2. steve.leach

    How standard is the standard library?

    steve.leach, Apr 18, 2005, in forum: Python
    Replies:
    1
    Views:
    404
    Christos TZOTZIOY Georgiou
    Apr 18, 2005
  3. Fuzzyman
    Replies:
    9
    Views:
    390
    Fuzzyman
    Jan 24, 2006
  4. Joe
    Replies:
    0
    Views:
    112
  5. Venks
    Replies:
    5
    Views:
    249
    Ken Bloom
    Dec 6, 2007
Loading...

Share This Page