Ofstream writes empty file on linux
- by commanderz
Hi,
I have a program which writes its output using ofstream. Everything works perfectly fine on Windows when compiled with Visual Studio, but it only writes empty file on Linux when compiled with GCC.
ofstream out(path_out_cstr, ofstream::out);
if(out.bad()){
cout << "Could not write the file" << flush;
}
else{
cout << "writing";
out << "Content" << endl;
if(out.fail()) cout << "writing failed";
out.flush();
out.close();
}
The directory which is being writen into has 0777 privileges.
Thanks for help