# returns a dirname unique to this process to write to
proc tmpdir {basename} {
- set dir [file join $::tmproot $basename.[pid].[incr ::tmpcounter]]
+ if {$::diskstore} {
+ # For diskstore we want to use the same dir again and again
+ # otherwise everything is too slow.
+ set dir [file join $::tmproot $basename.diskstore]
+ } else {
+ set dir [file join $::tmproot $basename.[pid].[incr ::tmpcounter]]
+ }
file mkdir $dir
set _ $dir
}