I posted a change yesterday to form.tcl, the purpose being to ensure
that temp files got deleted if the upload is aborted.  But I goofed
and changed ns_atclose to unlink; not good.

Here is another diff.  The idea is to unlink the main temp file right
after creating it, before ns_conncptofp has a chance to abort, and
register the "atclose" unlink commands right after the individual temp
files are opened.

Jim

*** form.tcl.aol        Tue Aug  1 13:36:17 2000
--- form.tcl    Sun Nov 24 08:52:55 2002
***************
*** 119,120 ****
--- 119,121 ----
            }
+           ns_unlink $tmpfile
            ns_conncptofp $fp
***************
*** 123,125 ****
            close $fp
-           ns_unlink $tmpfile
        }
--- 124,125 ----
***************
*** 201,202 ****
--- 201,203 ----
            }
+           ns_atclose "ns_unlink -nocomplain $tmpfile"

***************
*** 207,213 ****

-           ns_atclose "ns_unlink -nocomplain $tmpfile"
-
            close $tmp
            seek $fp $end
!           ns_set put $form $name.tmpfile $tmpfile

--- 208,212 ----

            close $tmp
            seek $fp $end
!           ns_set update $form $name.tmpfile $tmpfile

[jim /home/nsadmin/modules/tcl]$ sum form.tcl.aol
13540     7

Reply via email to