473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

vj
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.
Jul 22 '05 #1
1 1781
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
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: BlackHawke | last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses two programs- one to play the game, another to patch the game as updates come out. Players actually launch the updater...
73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
3
by: Gabriel Cooper | last post by:
What is the python equivalent to java's toString()? When debugging I want to be able to basically be able to do this: print MyObjectInstance or print str(MyObjectInstance) and have it...
1
by: iksrazal | last post by:
Hi all, I've been struggling to make this command work from Java: /usr/bin/mysql c4 --user=root --password=mypass -e "source /home/crissilva/c4.sql" Works fine as shown when run from the...
7
by: Rhino | last post by:
I am updating some Java UDFs from DB2GENERAL to DB2JAVA as suggested in the manuals for DB2 Version 8 but I'm having problems with setSQLstate() and setSQLmessage(). If I'm reading the manuals...
1
by: henrymania | last post by:
Am writing a code for database backup....by backupservlet is as given below i get the following exception
16
by: Knute Johnson | last post by:
I'm trying to write a C wrapper to run a Java program. I need to distribute a CD with the Java runtime, my application and a C startup program. I've put the C wrapper program, my java app and the...
6
by: mearvk | last post by:
Does C++ or C have something roughly equivalent to this: http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html What I need is a way to quickly convert between decimal and binary and...
4
hsn
by: hsn | last post by:
hello everyone. i am trying to run the sudo -i command in my mac. here is the code String s = null; try {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.