Check-in [fc90ef3457]
Overview
Comment:Create the synthetic data from a dict
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fc90ef345772ca06deeeaf85aebdefe8a6552f239f41c31ab6ada7095c2fd7ee
User & Date: rkeene on 2019-09-20 17:03:20
Other Links: manifest | tags
Context
2019-09-20
17:10
Added a script that uses a random filename for every input file check-in: c8a4c9f28e user: rkeene tags: trunk
17:03
Create the synthetic data from a dict check-in: fc90ef3457 user: rkeene tags: trunk
16:55
Also include a real file in the synthetic filesystem check-in: f4ea8e39b6 user: rkeene tags: trunk
Changes

Modified xvfs-create-synthetic from [4c3823a4cf] to [48aa2ff0d9].

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
#! /usr/bin/env tclsh

set sourceDirectory [file dirname [file normalize [info script]]]
lappend auto_path [file join $sourceDirectory lib]
package require xvfs

proc ::xvfs::callback::setOutputFileName {args} {
	return "/"
}

proc ::xvfs::callback::addOutputFiles {fsName} {
	::xvfs::processFile $fsName "" "" {
		type directory
		children "foo"
	}
	::xvfs::processFile $fsName "" "foo" {
		type file
		fileContents "abc"
	}
	::xvfs::processFile $fsName "./xvfs-create-synthetic" "xvfs-create-synthetic" {
		type file
	}
	return [list "" "foo" "xvfs-create-synthetic"]





}





::xvfs::run --directory [pwd] --name synthetic










<
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
|
>
|
>
>
>

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
#! /usr/bin/env tclsh

set sourceDirectory [file dirname [file normalize [info script]]]
lappend auto_path [file join $sourceDirectory lib]
package require xvfs

proc ::xvfs::callback::setOutputFileName {args} {
	return "/"
}


dict set ::myOwnVFS "" {
	type directory
	children {foo xvfs-create-synthetic}
}
dict set ::myOwnVFS "foo" {
	type file
	fileContents "abc"
}
dict set ::myOwnVFS "xvfs-create-synthetic" {
	type file
}

proc ::xvfs::callback::addOutputFiles {fsName} {
	dict for {outputName fileContentsDict} $::myOwnVFS {
		set inputFile $outputName
		if {[dict exists $fileContentsDict inputFile]} {
			set inputFile [dict get $fileContentsDict inputFile]
		}
		::xvfs::processFile $fsName $inputFile $outputName $fileContentsDict
	}
	return [dict keys $::myOwnVFS]
}

::xvfs::run --directory [pwd] --name synthetic