From: drh Date: Sat, 14 Aug 2004 17:10:10 +0000 (+0000) Subject: Add the ability to specify a alternative temporary file directory using the X-Git-Tag: version-3.6.10~4260 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab3f9fea05cfe584f18f9957a9904e7bd83b6688;p=thirdparty%2Fsqlite.git Add the ability to specify a alternative temporary file directory using the "sqlite_temp_directory" global variable. (CVS 1885) FossilOrigin-Name: fce56ba6a3c53843fabdfad4f545e35a83a01aa9 --- diff --git a/manifest b/manifest index 22aa6337f2..794ff320c3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Version\s3.0.4\s(beta)\s(CVS\s1884) -D 2004-08-09T00:26:58 +C Add\sthe\sability\sto\sspecify\sa\salternative\stemporary\sfile\sdirectory\susing\sthe\n"sqlite_temp_directory"\sglobal\svariable.\s(CVS\s1885) +D 2004-08-14T17:10:11 F Makefile.in 4a5e570a9e2d35b09c31b3cf01b78cea764ade4b F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -47,7 +47,7 @@ F src/os_mac.c 3d31e26be1411acfb7961033098631b4f3486fdf F src/os_mac.h 51d2445f47e182ed32d3bd6937f81070c6fd9bd4 F src/os_test.c 6bf10100de2ca199a91fe7ac6474561c8a7166ae F src/os_test.h 6a26a4978492e4bbdbf385554958418ff02db162 -F src/os_unix.c d084e3443211e1556f1a33fe48580e135facbcf7 +F src/os_unix.c 3239a45dbd2f50195bfc97f1ed35cb8fe5a3f60c F src/os_unix.h f3097815e041e82e24d92505e1ff61ba24172d13 F src/os_win.c 54181eb73cb4783c4241feca9eaa490768b39008 F src/os_win.h babd4e912967c6b09088cfe38a45e8005a07ba44 @@ -59,11 +59,11 @@ F src/printf.c 17b28a1eedfe8129b05de981719306c18c3f1327 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3 F src/select.c cbed45f4af76ad7fdfc0a0df6878b2b3827ae1d4 F src/shell.c 69d8036a8871c53603016cc6d240a3efaa9584df -F src/sqlite.h.in c340a12b4d0521efb474dd000fba3bdfb18d76da +F src/sqlite.h.in 7fa206b3c7740d891d087cd87c36f6885ce03e70 F src/sqliteInt.h 251662c89dd35c4ed745681ff00758d19ffd0906 F src/table.c 4521c278892f60e4d630788c0ea5cf4db1e75c49 F src/tclsqlite.c cece44ee1d4427185e4ac85ddec79f31ac26965a -F src/test1.c 9389fafc3c3a2a3b6bf4f7cffe1c7e8ccdd0be38 +F src/test1.c 56e7980918737ef6c45a6cb3afeb1b23e68ed19e F src/test2.c f4c2f3928f1998fd8cb75a81e33a60e025ea85d4 F src/test3.c 94d0a2a90bccd85802488cb42c69ec8afd2e4646 F src/test4.c c38766914e924091516030b6a8b677d849c08bf0 @@ -242,7 +242,7 @@ F www/tclsqlite.tcl 06a86cba4d7fc88e2bcd633b57702d3d16abebb5 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 72fb719bdd627694d89ea523dda3cf44537463a9 -R 90e96fde8e9b7dffc0f3f68d9146eaac +P 98edbdd5176704a3a8cbcb19614b51c59d748fda +R 982c1729c0a5e72a7a4f118d1decb57a U drh -Z 1c62f6e94ef5d400623d97aff1d08313 +Z 0b11b5a9cffe643b71abfc4d5fdccfb3 diff --git a/manifest.uuid b/manifest.uuid index 8372677320..5095c63fce 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -98edbdd5176704a3a8cbcb19614b51c59d748fda \ No newline at end of file +fce56ba6a3c53843fabdfad4f545e35a83a01aa9 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 4d6039161d..11e718290b 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -568,12 +568,20 @@ int sqlite3OsOpenDirectory( return SQLITE_OK; } +/* +** If the following global variable points to a string which is the +** name of a directory, then that directory will be used to store +** temporary files. +*/ +const char *sqlite_temp_directory = 0; + /* ** Create a temporary file name in zBuf. zBuf must be big enough to ** hold at least SQLITE_TEMPNAME_SIZE characters. */ int sqlite3OsTempFileName(char *zBuf){ static const char *azDirs[] = { + 0, "/var/tmp", "/usr/tmp", "/tmp", @@ -586,7 +594,9 @@ int sqlite3OsTempFileName(char *zBuf){ int i, j; struct stat buf; const char *zDir = "."; + azDirs[0] = sqlite_temp_directory; for(i=0; i