
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


