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:
15
src/os.c
15
src/os.c
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user