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