File: main.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 (43 lines) | stat: -rw-r--r-- 855 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
#
# NAME:		block
# DESCRIPTION:	return a string of length 512 (size of one HFS block)
#
proc block {} {
    set block "0123456789abcdef"
    set block "$block$block$block$block"
    set block "$block$block$block$block"
    set block "$block$block"

    return $block
}

#
# NAME:		mkvol
# DESCRIPTION:	create an empty test volume and mount it
#
proc mkvol {{size 1440} {path "image.hfs"}} {
    catch {humount $path}

    puts "Zeroing $path (${size}K)..."
    catch {exec rm -f $path}
    catch {exec dd if=/dev/zero of=$path bs=1k count=$size} msg
    puts $msg

    puts "Formatting $path..."
    hformat $path 0 "Test Volume"
}

#
# NAME:		remount
# DESCRIPTION:	flush and remount a volume
#
proc remount {{path "image.hfs"}} {
    puts "Remounting $path..."

    humount $path
    hmount $path 0
}

foreach test [glob test*.tcl] {
    source $test
}