Index: lib/xvfs/xvfs.tcl ================================================================== --- lib/xvfs/xvfs.tcl +++ lib/xvfs/xvfs.tcl @@ -97,16 +97,20 @@ array set fileInfo $fileInfoDict switch -exact -- $fileInfo(type) { "file" { set type "XVFS_FILE_TYPE_REG" - set fd [open $inputFile] - fconfigure $fd -encoding binary -translation binary -blocking true - set data [read $fd] + if {[info exists fileInfo(fileContents)]} { + set data $fileInfo(fileContents) + } else { + set fd [open $inputFile] + fconfigure $fd -encoding binary -translation binary -blocking true + set data [read $fd] + close $fd + } set size [string length $data] set data [string trimleft [binaryToCHex $data "\t\t\t"]] - close $fd } "directory" { set type "XVFS_FILE_TYPE_DIR" set children $fileInfo(children) set size [llength $children] @@ -203,10 +207,14 @@ processFile $fsName $inputFile $outputFile [array get fileInfo] lappend outputFiles $outputFile if {$isTopLevel} { + if {[info command ::xvfs::callback::addOutputFiles] ne ""} { + lappend outputFiles {*}[::xvfs::callback::addOutputFiles] + } + ::xvfs::_emitLine "\};" } return $outputFiles }