473,395 Members | 1,676 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.

Stderr redirection in VC 7 failed

Hi All,

I had a project which used to redirect stderr to a file in VC 6.
(working fine)

When I ported it to VC 7 it does not put messages in the file.

Any ideas???

Thanks,
Navanath

Nov 17 '05 #1
2 1071
This is the code I use to redirect stderr to the file

if (_wfreopen(L"stderr.txt",L"a+",stderr) == NULL)
{
fputs("Failed to reopen stderr", stderr);
}

and after this statement I use some api ABCD(...) which writes some
messages to stderr

in this case it does not write any message to the file.

If I uncomment above redirection then calling the api does write the
messages to the console screen(which by default is stderrr).

Please let me know hwo can I redirect these messages to the file!!!

Thanks,
Navanath

ndessai wrote:
Hi All,

I had a project which used to redirect stderr to a file in VC 6.
(working fine)

When I ported it to VC 7 it does not put messages in the file.

Any ideas???

Thanks,
Navanath


Nov 17 '05 #2
On Thu, 24 Jun 2004 10:29:59 +0530, ndessai <nd******@netscape.net>
wrote:
Hi All,

I had a project which used to redirect stderr to a file in VC 6.
(working fine)

When I ported it to VC 7 it does not put messages in the file.


The standard way is to use freopen I think, although my C expertise is
patchy. Redirecting cerr is done with rdbuf.

Tom
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Nov 17 '05 #3

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

Similar topics

5
by: Helmut Jarausch | last post by:
Hi when using an interactive Python script, I'd like the prompt given by raw_input to go to stderr since stdout is redirected to a file. How can I change this (and suggest making this the...
0
by: Roman Neuhauser | last post by:
Hello, I have a piece of code that gets run in a script that has its stdout closed: import sys sys.stdout = sys.stderr c = subprocess.Popen (..., stdin = subprocess.PIPE,
7
by: ndessai | last post by:
Hi All, I discovered following issue with the VC 7.1 compiler regarding the backword compatibility. I created a dll (Redirect.dll) which exposes a function and simply writes some text (say...
37
by: Vince C. | last post by:
Hi all. I've installed Bloodshed Dev-C++ on a Windows 2000 SP4 machine. I'm using MinGW 3.4.2. I'd like to temporarily disable standard functions to write to stderr, i.e. for instance...
1
by: reubendb | last post by:
Hello, I have some function that output too much stuff to stderr when called, and I have no control over the function itself. So I thought as a workaround, I redirect stderr to /dev/null before...
1
by: Erik Jones | last post by:
So, I was just taking a look at doctest.py and saw this: Then running the module as a script will cause the examples in the docstrings to get executed and verified: python M.py This won't...
1
by: grbgooglefan | last post by:
I am in a perculiar situation. I want to use PyRun_SimpleString for creating Python functions in embedded Python in C++. But there could be cases when Python function code compilation could fail &...
5
by: sakismat | last post by:
please help how can I get stderr from processes ($proc) in my screen without waiting the other processes to end #!/usr/bin/php <?php $con = mysql_connect("localhost", "user"); if (!$con)
10
by: Isaac Gouy | last post by:
$ ./test_fail 1 Floating point exception - but this leaves 'somefile' zero size $ ./test_fail 1>somefile Floating point exception
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.