File: tmpfile.tcl

package info (click to toggle)
redis 5%3A8.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,920 kB
  • sloc: ansic: 217,146; tcl: 51,883; sh: 4,625; perl: 4,214; cpp: 3,568; python: 3,165; makefile: 2,055; ruby: 639; javascript: 30; csh: 7
file content (15 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
set ::tmpcounter 0
set ::tmproot "./tests/tmp"
file mkdir $::tmproot

# returns a dirname unique to this process to write to
proc tmpdir {basename} {
    set dir [file join $::tmproot $basename.[pid].[incr ::tmpcounter]]
    file mkdir $dir
    set _ $dir
}

# return a filename unique to this process to write to
proc tmpfile {basename} {
    file join $::tmproot $basename.[pid].[incr ::tmpcounter]
}