Hi, Sorcery-ltd. Thank you for reply.
If the file doesn't exist then these are programming errors, you should always check if the file exists or specify that you want it created if it doesn't exist already. This is regardless of the environment.
Here is the text from MSDN documentation (no Microsoft specific):
Code:
FILE *fopen(
const char *filename,
const char *mode
);
FILE *_wfopen(
const wchar_t *filename,
const wchar_t *mode
);
Parameters
filename
Filename.
mode
Type of access permitted.
Return Value
Each of these functions returns a pointer to the open file. A null pointer value indicates an error. ...
and the classic fstream example from stl book:
Code:
#include <fstream>
#include <string>
using namespace std;
void func(const string &filename)
{
ifstream file(filename.c_str());
if (file)
{
... // is opened
}
else
{
... // error
}
}
By the way, I've tried a name of an existent nonempty file and have got the same result...