A
AJ
Hello, I was wondering if it is possible to create a file if it doean't
exist. I am using fstream and writing in and out a binary file. I check to
see if the file is opened. if it doesn't get opened, i want to create the
file. I was wondering if this can be done. This is the code i have for
opening the file:
fstream rfile("names.db", ios::binary| ios::in | ios:ut);
if ( !rfile ) {
cerr << "Could not open file 'names.db'\n";
}
I am hoping to put the creating of the file after the cerr. i hope someone
can help me out with this. thanks.
AJ
exist. I am using fstream and writing in and out a binary file. I check to
see if the file is opened. if it doesn't get opened, i want to create the
file. I was wondering if this can be done. This is the code i have for
opening the file:
fstream rfile("names.db", ios::binary| ios::in | ios:ut);
if ( !rfile ) {
cerr << "Could not open file 'names.db'\n";
}
I am hoping to put the creating of the file after the cerr. i hope someone
can help me out with this. thanks.
AJ