File: tmpfile.tcl

package info (click to toggle)
redis 2%3A2.8.17-1%2Bdeb8u5
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 6,524 kB
  • ctags: 9,607
  • sloc: ansic: 71,922; tcl: 9,383; perl: 3,931; sh: 3,602; makefile: 1,001; ruby: 244
file content (15 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (16)
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]
}