Write entire file: Difference between revisions

added Tcl
(added Tcl)
Line 69:
{{out}}
<pre>100000 100000</pre>
 
=={{header|Tcl}}==
 
<lang Tcl>proc writefile {filename data} {
set fd [open $filename w] ;# truncate if exists, else create
try {
puts -nonewline $fd $data
} finally {
close $fd
}
}</lang>
 
A more elaborate version of this procedure might take optional arguments to pass to <tt>fconfigure</tt> (such as encoding) or <tt>open</tt> (such as permissions).
 
 
=={{header|zkl}}==
Anonymous user