What i can see from the output is that it looks like the Tcl file tempfile subcommand looks broken. The command below
::file tempfile tmpFileName $template
seems to be ignoring the privided template mostly. From the commands below,
set template "c:/naviserver/servers/openacs/tmp/nsd-XXXXXX"
set file [::file tempfile tmpFileName $template]
the expected tmpFileName is wrong
expected: c:/naviserver/servers/openacs/tmp/nsd-29771
you got: c:/WINDOWS/TEMP/nsd-XXXXXX29771.TMP
Please double-check this. Of course, the numeric part will differ. If my hypothesis is correct, then please replace the function ns_opentmpfile in ns/tcl/form.tcl with the following
proc ns_opentmpfile {varFilename {template ""}} {
upvar $varFilename tmpFileName
if {$template eq ""} {
set template [ns_config ns/parameters tmpdir]/nsd-XXXXXX
}
if {$::tcl_platform(platform) eq "windows"} {
set tmpFileName [ns_mktemp -nocomplain $template]
return [open $tmpFileName {RDWR CREAT EXCL}]
} else {
return [::file tempfile tmpFileName {*}$template]
}
}
This is not the perfect solution and violates security considerations (creating the time file should be an atomic operation, we do it here like in old Tcl implementations), but it is as good as it gets with reasonable effort.
If my suspicion is true, I would regard this as a bug in Tcl, although the documentation in Tcl is very vague on this point. It says:
though some platforms may ignore some or all of these parts and use a built-in default instead.”
What version of Tcl are you using?
All the best
-g