1 # XXX This actually creates a Unicode (UCS-2) array. It's also rather
2 # slow to run. It's possible we should be using a list instead.
3 set disk
[string repeat
"\u0000" [expr 1024*1024]]
5 proc plugin_open
{readonly
} {
12 return [string length
$disk]
15 proc pread
{h count offset
} {
18 set last
[expr $offset+$count-1]
19 return [string range
$disk $offset $last]
22 proc pwrite
{h buf offset
} {
25 set count
[string length
$buf]
26 set last
[expr $offset+$count-1]
27 set disk
[string replace
$disk $offset $last $buf]