File: test2.tcl

package info (click to toggle)
hfsutils 3.2.6-16
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,680 kB
  • sloc: ansic: 12,858; tcl: 1,937; makefile: 566; sh: 156; perl: 29
file content (74 lines) | stat: -rw-r--r-- 1,257 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# NAME:		test2
# DESCRIPTION:	create hundreds of files and directories
#
proc test2 {} {
    global curvol

    set block [block]

    mkvol

    puts "Creating files and directories..."

    foreach dir {one two three four five six seven eight nine ten} {
	puts -nonewline [format "%6s: " $dir]

	hmkdir $dir
	hcd $dir

	foreach subdir {a b c d e f g h i j} {
	    puts -nonewline "$subdir "
	    flush stdout

	    hmkdir "$dir/$subdir"
	    hcd "$dir/$subdir"

	    foreach subsubdir {1 2 3 4 5 6 7 8 9 10} {
		hmkdir "$dir/$subdir/$subsubdir"

		set fname ":$dir/$subdir/$subsubdir:$dir/$subdir/$subsubdir/File"

		set fd [$curvol create $fname "TEXT" "UNIX"]
		$fd write $block
		$fd close
	    }

	    hcd ::
	}

	hcd ::

	puts ""
    }

    remount

    puts "Deleting files..."

    foreach dir {one two three four five six seven eight nine ten} {
	puts -nonewline [format "%6s: " $dir]

	hcd $dir

	foreach subdir {a b c d e f g h i j} {
	    puts -nonewline "$subdir "
	    flush stdout

	    hcd "$dir/$subdir"

	    foreach subsubdir {2 4 6 8 10} {
		hdel ":$dir/$subdir/$subsubdir:$dir/$subdir/$subsubdir/File"
		# hrmdir "$dir/$subdir/$subsubdir"
	    }

	    hcd ::
	    # hrmdir "$dir/$subdir"
	}

	hcd ::
	# hrmdir $dir

	puts ""
    }
}