Hi,
im trying to code a tcl from that i can manage lftp commands from a channel so i can do backups and so on from that chan without connecting to a shell. Is it possible to have read and write acces to lftp commands from tcl. I tried with following method - but this seems not to work as i expected - and leads to bots timeouts:
set fxpclient ""
bind pub - "!open" p_open
bind pub - "!ls" p_ls
bind pub - "!close" p_close
proc p_ls { nick uhost handle channel text } {
global fxpclient
puts $fxpclient "ls"
}
proc p_close { nick uhost handle channel text } {
global fxpclient
close $fxpclient
}
proc p_open { nick uhost handle channel text } {
global fxpclient
putlog "open"
set fxpclient [open "|lftp whatever.com:21" r+]
utimer 1 p_gets
puts $fxpclient "USER test pass"
putlog "open done"
}
proc p_gets {} {
global fxpclient
set tmp [gets $fxpclient]
if {[llength $tmp] > 0 } {
putlog "$tmp"
}
utimer 1 p_gets
}
i tried to read every second the output from lftp to show that. But this seems not the way to do that someone any ideas? thanx in advance.