From 83acd423a1bca7c95cae4a4c9af918e3ebc00d59 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 18 Jun 2010 11:10:06 +0000 Subject: 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 --- src/os_unix.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/os_unix.c') diff --git a/src/os_unix.c b/src/os_unix.c index 574f48d18..9966ed609 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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; } -- cgit v1.2.3