Tcl Source Code

Artifact [e7c8dfe0c8]
Login

Artifact e7c8dfe0c89f06041ea184268b449d37b5f08f2c:

Attachment "iotrap.tcl" to ticket [ed29c4da21] added by aku 2014-10-09 22:40:28.

puts [package require Tcl 8.5]
puts [package require http]

proc P {args} { puts -nonewline . ; flush stdout ; return }

set outname "saturn.jpg"
set url "http://apod.nasa.gov/apod/image/1409/saturnequinox_cassini_7227.jpg"

set out [open $outname w]
fconfigure $out -translation binary
set token [::http::geturl $url -binary 1 -channel $out -progress P]

close $out
puts done
exit