1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Enhancement to Windows "file-exists" function by Joel Lucsy. (CVS 374)

FossilOrigin-Name: d3d59261da9bef3250e99444167ad6ef98764574
This commit is contained in:
drh
2002-02-18 12:48:45 +00:00
parent d820cb1b75
commit 5ae7af7cc2
3 changed files with 8 additions and 21 deletions

View File

@@ -210,20 +210,7 @@ int sqliteOsFileExists(const char *zFilename){
return access(zFilename, 0)==0;
#endif
#if OS_WIN
HANDLE h;
h = CreateFile(zFilename,
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
NULL
);
if( h!=INVALID_HANDLE_VALUE ){
CloseHandle(h);
return 1;
}
return 0;
return GetFileAttributes(zFilename) != 0xffffffff;
#endif
}