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

@ -1,5 +1,5 @@
C Merge\strunk\schange\s[7c3a86b9c7].
D 2010-06-17T16:44:53
C Change\sthe\simplementation\sof\sthe\sunix\simplementation\sof\sxAccess()\sso\sthat\sit\sreturns\s0\s(does\snot\sexist)\sto\san\sSQLITE_ACCESS_EXISTS\squery\son\sa\sfile\sthat\sexists\sbut\sis\szero\sbytes\sin\ssize.
D 2010-06-18T11:10:07
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -154,7 +154,7 @@ F src/os.c 9c4a2f82a50306a33907678ec0187b6ad1486bfe
F src/os.h d7775504a51e6e0d40315aa427b3e229ff9ff9ca
F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19
F src/os_unix.c ae173c9f6afaa58b2833a1c95c6cd32021755c42
F src/os_unix.c 2555f00c4c777539c33a2ef0e65f71cff08a6fa0
F src/os_win.c dfde7d33c446e89dd9a277c036f2c4cc564b3138
F src/pager.c 5968e0d73febd2e1c9e4e785660bdf49ff2e2cab
F src/pager.h ca1f23c0cf137ac26f8908df2427c8b308361efd
@ -824,7 +824,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P b9b11855e8a9522309dd30e5256bb67d67e1353a 7c3a86b9c7e2a35ce755c32b38e911e79d843fad
R 9b3c0e89ee34bf70754dc9094b410e06
P bd7bc4e0e28bc749034ff1a9290a69330c5d8ca4
R 2b113c40a63b7748c0ad882d1483f64f
U dan
Z cddd2246fd2d00b78e84c3f7e0542efe
Z 8ecd2203ce71c16c5fd05e7fedfa658b

View File

@ -1 +1 @@
bd7bc4e0e28bc749034ff1a9290a69330c5d8ca4
077b0e5bcd849130c8df373fc2134c4b44351882

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;
}