Changeset 17879

Show
Ignore:
Timestamp:
17.11.2008 18:38:17 (11 years ago)
Author:
ak19
Message:

For the new archiveinf-doc.ldb and archiveinf-src.ldb to be generated on a Windows machine, the GDBM_WRCREAT flag needed to be set. This will now create the required database unless it already exists.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/common-src/src/gdbmedit/gdbmset/gdbmset.cpp

    r17782 r17879  
    6767int main (int argc, char *argv[])  
    6868{ 
     69  // The block_size parameter  is  ignored unless the file is a new file. 
     70  // If it is less than 512, dbm will use the  stat  block size for the file system. 
    6971  int block_size = 0; 
    7072  GDBM_FILE dbf; 
     
    7981  // open the database 
    8082#ifdef __WIN32__ 
    81   dbf = gdbm_open (argv[1], block_size, GDBM_WRITER, 00664, NULL, 0); 
     83  // On Windows need to make sure the database is generated if it does not already exist 
     84  // GDBM_WRCREAT flag means: open database for read/write, create if necessary 
     85  // http://www.rt.com/man/gdbm.3.html is the Unix man page on gdbm_open  
     86  // http://trac.greenstone.org/changeset/928 - the 6th param of gdbm_open (only in the 
     87  // Windows version of the function) was set to 1 when using WRCREAT 
     88  // http://www.sfr-fresh.com/unix/misc/q-7.11.tar.gz:a/q-7.11/modules/gdbm/README-Gdbm 
     89  dbf = gdbm_open (argv[1], block_size, GDBM_WRCREAT, 00664, NULL, 1); 
    8290#else 
    8391  dbf = gdbm_open  (argv[1], block_size, GDBM_WRITER, 00664, NULL);