> I was debugging something in my program and noticed my debug logs files
> weren't getting flushed to disk. I'm using C++ standard I/O calls to do
[quoted text clipped - 28 lines]
> and it doesn't seem have this issue). Thanks,
> Micah
This is our bug, sorry. It has been fixed for 9.2 (not yet released).
If you would like to patch your MSL, open <msl_c_filebuf>. Add:
template <class charT, class traits>
int
c_filebuf<charT, traits>::sync()
{
int result = base::sync();
if (result >= 0)
result = _CSTD::fflush(file_);
return result;
}
anywhere outside of the class declaration. Also add a declaration for
this function in the protected section:
protected:
virtual int sync();
There is no need to recompile MSL C++ after this change. But if you are
using precompiled headers you will need to rebuild them.
-Howard
Metrowerks
Micah Koch - 27 Jan 2004 19:45 GMT
Works like a charm. Thanks Howard,
Micah
In article
<hinnant-523EAB.09002827012004@syrcnyrdrs-03-ge0.nyroc.rr.com>,
> <snip>
>
[quoted text clipped - 5 lines]
> -Howard
> Metrowerks
Hartwig Wiesmann - 29 Jan 2004 18:15 GMT
Hi Howard,
I do not know if I/O to "cout" also uses the "sync" function. At least
I/O with SIOUX and writing to "cout" also does not flush the buffer.
Hartwig
>>I was debugging something in my program and noticed my debug logs files
>>weren't getting flushed to disk. I'm using C++ standard I/O calls to do
[quoted text clipped - 54 lines]
> -Howard
> Metrowerks
MW Ron - 29 Jan 2004 19:33 GMT
>Hi Howard,
>
>I do not know if I/O to "cout" also uses the "sync" function. At least
>I/O with SIOUX and writing to "cout" also does not flush the buffer.
I think Howard has more vacation time coming but I'll pass this on to
him and the MSL team.
Ron
>>>I was debugging something in my program and noticed my debug logs files
>>>weren't getting flushed to disk. I'm using C++ standard I/O calls to do
[quoted text clipped - 54 lines]
>> -Howard
>> Metrowerks

Signature
Metrowerks, maker of CodeWarrior - "Software Starts Here"
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>
Howard Hinnant - 29 Jan 2004 20:42 GMT
> I do not know if I/O to "cout" also uses the "sync" function. At least
> I/O with SIOUX and writing to "cout" also does not flush the buffer.
Yes, you are correct, cout has the same bug. To fix, open
<msl_consolebuf>. There are two classes in this header:
console_inputbuf and console_outputbuf. Only console_outputbuf needs
patching:
template <class charT, class traits>
int
console_outputbuf<charT, traits>::sync()
{
int result = base::sync();
if (result >= 0)
result = _CSTD::fflush(file_);
return result;
}
-Howard
Metrowerks