From 1fb26db29805d4822763c205358f394725b0f02c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 2 Mar 2009 05:18:58 +0100 Subject: [PATCH] Output file generated at very end rather than at beginning. Output is produced to a temporary file (.tmp) and then renamed at very end if operation is succesful. --- src/charconv.tcl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/charconv.tcl b/src/charconv.tcl index 4412c2a..f09b82e 100644 --- a/src/charconv.tcl +++ b/src/charconv.tcl @@ -414,7 +414,7 @@ if {![info exists ifiles]} { usage } -set ofilehandle [open $ofile w] +set ofilehandle [open ${ofile}.tmp w] preamble_trie $ofilehandle $ifiles $ofile foreach ifile $ifiles { @@ -422,4 +422,6 @@ foreach ifile $ifiles { } close $ofilehandle +file rename -force ${ofile}.tmp ${ofile} + -- 1.7.10.4