Operating System - Tru64 Unix
1755601 Members
4540 Online
108836 Solutions
New Discussion

wofstream unable to update a file

 
Abhik Das
Occasional Contributor

wofstream unable to update a file

Hi,

Here is the scenario...

#include
#include
#include
int main()
{
std::wofstream file;
file.open("tmp",std::ios_base::out|std::ios_base::app, 0666);
if (file.is_open())
cout<<"File open"< else
cout<<"File not opened"< std::wstring wstr(L"abc");
/*
file<file<*/
file< file.close();
}

//cxx version V6.5-042
//compiled as: cxx file.cpp -D__USE_STD_IOSTREAM

In case the file is opened for std::ios_base::ate, it truncates the contents rather than appending to last!

Any comments if this is a bug?
Is there any patch available for this?