source ftp.tcl       ; # Direct load, TE is in the tcllib/modules/ftp directory.
set ::ftp::VERBOSE 1 ; # Unthrottle debug output in the ftp module itself.
set ::ftp::DEBUG 1   ; # The ftp.tcl in question is revision 1.45

# Test async get using public ftp server and anon-login

set ftpdone	0

proc ftpdone args {
	global ftpdone
	puts stderr "FTPDONE: [incr ftpdone]"
}

set chan [open XOUT w]
set token [ftp::Open ftp.tcl.tk anonymous a@b -command ftpdone]
vwait ftpdone
vwait ftpdone
ftp::Cd  $token pub/tcl
vwait ftpdone
vwait ftpdone
ftp::Get $token README.tclversions -channel $chan
vwait ftpdone
vwait ftpdone
close $chan
