/ Check-in [88447d45]
Login
Overview
Comment:Fix a temp file problem on memory: (CVS 188)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:88447d45c8ac316868a8a3e3cbb0b0cdf279d89c
User & Date: drh 2001-02-19 23:48:17
Context
2001-02-20
00:00
Version 1.0.23 (CVS 480) check-in: cbfa44c3 user: drh tags: trunk
2001-02-19
23:48
Fix a temp file problem on memory: (CVS 188) check-in: 88447d45 user: drh tags: trunk
23:30
Version 1.0.22 (CVS 481) check-in: ec861066 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to VERSION.

1
1.0.22
|
1
1.0.23

Changes to src/dbbemem.c.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
...
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
** This file contains code to implement the database backend (DBBE)
** for sqlite.  The database backend is the interface between
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses an in-memory hash table as the database backend. 
**
** $Id: dbbemem.c,v 1.7 2001/01/15 22:51:10 drh Exp $
*/
#include "sqliteInt.h"
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>

................................................................................
static int sqliteMemOpenTempFile(Dbbe *pDbbe, FILE **ppFile){
  const char *zTemps[] = { "/usr/tmp", "/var/tmp", "/tmp", "/temp", 0};
  const char *zDir;
  int i;
  struct stat statbuf;
  for(i=0; zTemps[i]; i++){
    zDir = zTemps[i];
    if( stat("/usr/tmp", &statbuf)==0 && S_ISDIR(statbuf.st_mode) 
      && access("/usr/tmp", W_OK|X_OK)==0 ){
        break;
    }
  }
  if( zDir==0 ) zDir = ".";
  return sqliteDbbeOpenTempFile(zDir, pDbbe, ppFile);
}








|







 







|
|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
...
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
** This file contains code to implement the database backend (DBBE)
** for sqlite.  The database backend is the interface between
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses an in-memory hash table as the database backend. 
**
** $Id: dbbemem.c,v 1.8 2001/02/19 23:48:17 drh Exp $
*/
#include "sqliteInt.h"
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>

................................................................................
static int sqliteMemOpenTempFile(Dbbe *pDbbe, FILE **ppFile){
  const char *zTemps[] = { "/usr/tmp", "/var/tmp", "/tmp", "/temp", 0};
  const char *zDir;
  int i;
  struct stat statbuf;
  for(i=0; zTemps[i]; i++){
    zDir = zTemps[i];
    if( stat(zDir, &statbuf)==0 && S_ISDIR(statbuf.st_mode) 
      && access(zDir, W_OK|X_OK)==0 ){
        break;
    }
  }
  if( zDir==0 ) zDir = ".";
  return sqliteDbbeOpenTempFile(zDir, pDbbe, ppFile);
}

Changes to www/changes.tcl.

12
13
14
15
16
17
18







19
20
21
22
23
24
25
}


proc chng {date desc} {
  puts "<DT><B>$date</B></DT>"
  puts "<DD><P><UL>$desc</UL></P></DD>"
}








chng {2001 Feb 19 (1.0.22)} {
<li>The previous fix was not quite right.  This one seems to work better.
    </li>
}

chng {2001 Feb 19 (1.0.21)} {







>
>
>
>
>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
}


proc chng {date desc} {
  puts "<DT><B>$date</B></DT>"
  puts "<DD><P><UL>$desc</UL></P></DD>"
}

chng {2001 Feb 19 (1.0.23)} {
<li>An unrelated (and minor) bug from Mark Muranwski fixed.  The algorithm
    for figuring out where to put temporary files for a "memory:" database
    was not working quite right.
    </li>
}

chng {2001 Feb 19 (1.0.22)} {
<li>The previous fix was not quite right.  This one seems to work better.
    </li>
}

chng {2001 Feb 19 (1.0.21)} {