handle=CreateFile(fn.c_str(), flags, 0, 0, create_flags, FILE_ATTRIBUTE_NORMAL, 0);
if(handle==INVALID_HANDLE_VALUE)
- throw SystemError(format("Can't open file '%s'", fn), GetLastError());
+ {
+ int err=GetLastError();
+ if(err==ERROR_FILE_NOT_FOUND)
+ throw FileNotFound("Can't find file "+fn, fn);
+ else
+ throw SystemError(format("Can't open file '%s'", fn), GetLastError());
+ }
#else
int flags=0;
switch(mode&M_RDWR)