]> git.saurik.com Git - redis.git/blame_incremental - tests/support/tmpfile.tcl
test adapted to run with diskstore, and a few bugs fixed
[redis.git] / tests / support / tmpfile.tcl
... / ...
CommitLineData
1set ::tmpcounter 0
2set ::tmproot "./tests/tmp"
3file mkdir $::tmproot
4
5# returns a dirname unique to this process to write to
6proc tmpdir {basename} {
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 }
14 file mkdir $dir
15 set _ $dir
16}
17
18# return a filename unique to this process to write to
19proc tmpfile {basename} {
20 file join $::tmproot $basename.[pid].[incr ::tmpcounter]
21}