]>
Commit | Line | Data |
---|---|---|
98578b57 | 1 | set ::tmpcounter 0 |
ab72b483 | 2 | set ::tmproot "./tests/tmp" |
98578b57 PN |
3 | file mkdir $::tmproot |
4 | ||
5 | # returns a dirname unique to this process to write to | |
6 | proc tmpdir {basename} { | |
5e1d2d30 | 7 | if {$::diskstore} { |
8 | # For diskstore we want to use the same dir again and again | |
9 | # otherwise everything is too slow. | |
10 | set dir [file join $::tmproot $basename.diskstore] | |
11 | } else { | |
12 | set dir [file join $::tmproot $basename.[pid].[incr ::tmpcounter]] | |
13 | } | |
98578b57 PN |
14 | file mkdir $dir |
15 | set _ $dir | |
16 | } | |
17 | ||
18 | # return a filename unique to this process to write to | |
19 | proc tmpfile {basename} { | |
20 | file join $::tmproot $basename.[pid].[incr ::tmpcounter] | |
21 | } |