1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Change the implementation of the unix implementation of xAccess() so that it returns 0 (does not exist) to an SQLITE_ACCESS_EXISTS query on a file that exists but is zero bytes in size.

FossilOrigin-Name: 077b0e5bcd849130c8df373fc2134c4b44351882
This commit is contained in:
dan
2010-06-18 11:10:06 +00:00
parent cd27cffa97
commit 83acd423a1
3 changed files with 13 additions and 7 deletions

View File

@@ -4618,6 +4618,12 @@ static int unixAccess(
assert(!"Invalid flags argument");
}
*pResOut = (access(zPath, amode)==0);
if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){
struct stat buf;
if( 0==stat(zPath, &buf) && buf.st_size==0 ){
*pResOut = 0;
}
}
return SQLITE_OK;
}