# $Header: /home/cvsroot/tcldb/ucodb/Tlib/saveEdit,v 1.1.1.1 1996/10/12 01:08:26 de Exp $
#
proc saveEdit {box filename} {

	set unique [getclock]

	set win .[lindex [split $box .] 1]
	set wlist [winfo children $win]
	$win configure -cursor watch
	foreach child $wlist {
		$child configure -cursor watch
	}

	set of "$filename.$unique"
	set err [catch {set ofp [open $of w]}]
	if {$err} {
		set of "/tmp/$filename.$unique"	
		set ofp [open $of w]
	}

	set lines [split [$box get 1.0 end] \n]

	foreach line $lines {
	
		puts $ofp "[stringFix2 $line out]"

	}

	close $ofp

	$win configure -cursor {}
	foreach child $wlist {
		$child configure -cursor {}
	}
	echo "Output is in file $of"
}
