c8742de968 2019-09-20 1: #! /usr/bin/env tclsh
c8742de968 2019-09-20 2:
c8742de968 2019-09-20 3: set sourceDirectory [file dirname [file normalize [info script]]]
c8742de968 2019-09-20 4: lappend auto_path [file join $sourceDirectory lib]
c8742de968 2019-09-20 5: package require xvfs
c8742de968 2019-09-20 6:
c8742de968 2019-09-20 7: proc ::xvfs::callback::setOutputFileName {args} {
c8742de968 2019-09-20 8: return "/"
c8742de968 2019-09-20 9: }
c8742de968 2019-09-20 10:
fc90ef3457 2019-09-20 11: dict set ::myOwnVFS "" {
fc90ef3457 2019-09-20 12: type directory
fc90ef3457 2019-09-20 13: children {foo xvfs-create-synthetic}
fc90ef3457 2019-09-20 14: }
fc90ef3457 2019-09-20 15: dict set ::myOwnVFS "foo" {
fc90ef3457 2019-09-20 16: type file
fc90ef3457 2019-09-20 17: fileContents "abc"
fc90ef3457 2019-09-20 18: }
fc90ef3457 2019-09-20 19: dict set ::myOwnVFS "xvfs-create-synthetic" {
fc90ef3457 2019-09-20 20: type file
fc90ef3457 2019-09-20 21: }
fc90ef3457 2019-09-20 22:
fc90ef3457 2019-09-20 23: proc ::xvfs::callback::addOutputFiles {fsName} {
fc90ef3457 2019-09-20 24: dict for {outputName fileContentsDict} $::myOwnVFS {
fc90ef3457 2019-09-20 25: set inputFile $outputName
fc90ef3457 2019-09-20 26: if {[dict exists $fileContentsDict inputFile]} {
fc90ef3457 2019-09-20 27: set inputFile [dict get $fileContentsDict inputFile]
fc90ef3457 2019-09-20 28: }
fc90ef3457 2019-09-20 29: ::xvfs::processFile $fsName $inputFile $outputName $fileContentsDict
fc90ef3457 2019-09-20 30: }
fc90ef3457 2019-09-20 31: return [dict keys $::myOwnVFS]
c8742de968 2019-09-20 32: }
c8742de968 2019-09-20 33:
c8742de968 2019-09-20 34: ::xvfs::run --directory [pwd] --name synthetic