Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -198,10 +198,14 @@ ) #f ) ) +(define (dbfile:make-tmpdir-name areapath) + (let* ((dname (conc "/tmp/"(current-user-name)"/" (string-translate areapath "/" ".")))) + (create-directory dname #t) + dname)) (define (dbfile:run-id->path apath run-id) (conc apath"/"(dbfile:run-id->dbname run-id))) (define (db:dbname->path apath dbname) Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -173,22 +173,19 @@ ;; * This routine creates the db if not found ;; * Probably can get rid of the dbstruct-in ;; (define (dbmod:open-dbmoddb areapath run-id dbfname-in init-proc keys #!key (dbstruct-in #f) - (syncdir 'todisk)) + ;; (dbcontext 'megatest) ;; use dashboard to do the dashboard + (syncdir 'todisk)) ;; todisk is used when caching in /tmp and writing data back to MTRAH (let* ((dbstruct (or dbstruct-in (make-dbr:dbstruct areapath: areapath))) (dbfname (or dbfname-in (dbmod:run-id->dbfname run-id))) (dbpath (dbmod:get-dbdir dbstruct)) ;; directory where all the .db files are kept (dbfullname (conc dbpath"/"dbfname)) ;; (dbmod:run-id->full-dbfname dbstruct run-id)) (dbexists (file-exists? dbfullname)) - (tmpdir (conc "/tmp/"(current-user-name))) - (tmpdb (let* ((fname (conc tmpdir"/" (string-translate areapath "/" ".") ;; "-"(current-process-id) - "-"dbfname))) - (if (not (file-exists? tmpdir))(create-directory tmpdir)) - ;; check if tmpdb already exists, either delete it or - ;; add something to the name + (tmpdir (dbfile:make-tmpdir-name areapath)) + (tmpdb (let* ((fname (conc tmpdir"/"dbfname))) fname)) (cachedb (dbmod:open-cachedb-db init-proc ;; (if (eq? (dbfile:cache-method) 'cachedb) ;; #f tmpdb