<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/4781" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-07-06T03:37:30-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/4781</id>

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-07-06T03:37:30-04:00</updated>

		<published>2003-07-06T03:37:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23114#p23114</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23114#p23114"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23114#p23114"><![CDATA[
Hmm, if lftp itself is caching the output, there isn't a lot you can do. But, if you send lftp the "quit" command, it should exit and send all of the cached output at once. You have to check for eof (use the 'eof' command) in your lftp_reader proc, and then close $lftp when eof is detected.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Jul 06, 2003 3:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tR]]></name></author>
		<updated>2003-07-06T01:43:36-04:00</updated>

		<published>2003-07-06T01:43:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23107#p23107</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23107#p23107"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23107#p23107"><![CDATA[
yes. I tried now with the normal ftp command and this works fine. Only <br>on lftp there seems to be a buffer between stdout output. On bash i didnt see a difference between the ftp in/output and the lftp in/output. I also tried with different translate settings but this also dont help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=509">tR</a> — Sun Jul 06, 2003 1:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-07-05T18:17:18-04:00</updated>

		<published>2003-07-05T18:17:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23087#p23087</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23087#p23087"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23087#p23087"><![CDATA[
Did you use flush after puts?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Jul 05, 2003 6:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tR]]></name></author>
		<updated>2003-07-05T17:01:08-04:00</updated>

		<published>2003-07-05T17:01:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23083#p23083</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23083#p23083"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23083#p23083"><![CDATA[
Thanx for the fast reply. That works as described. Only problem remaining ist that it seems that stdout is cached somewhow <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> so i had to do a few commands until stdout buffer is full and then the readable event fires.<br>i tried fconfigure $lftp -buffering none or a little bufersize but it seems that this not affects the stdout buffer. Maybe its the buffer outside tcl that makes the problems. Maybe a  idea how i can avoid that? Thanx in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=509">tR</a> — Sat Jul 05, 2003 5:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-07-05T13:03:57-04:00</updated>

		<published>2003-07-05T13:03:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23069#p23069</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23069#p23069"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23069#p23069"><![CDATA[
You don't need to use the writable event. That's really for if you write so much data that it starts blocking, but you're only going to send a few commands.<br><br>So, instead of the "filevent writable" bit, just have, "puts $lftp yourcommand". The other thing you're missing is "flush $lftp" whenever you use puts (immediately after). Because you have the "-buffering full" option, it doesn't write the data until you call "flush".<br><br>Also, in p_cmd, you'll want to again do "puts $lftp $text" and "flush $lftp" rather than wait for the writable event.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Jul 05, 2003 1:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tR]]></name></author>
		<updated>2003-07-05T11:04:40-04:00</updated>

		<published>2003-07-05T11:04:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23066#p23066</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23066#p23066"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23066#p23066"><![CDATA[
no im using lftp - a external program. the ftp lib doesnt suply server to server transfer and i need that for the backups.<br>i tried with the commands suggested by stdragon but it seems not to work.<br><br>Here the code:<br><br>bind pub - "!cmd" p_cmd<br>set lftp_cmd ""<br><br>proc lftp_reader {lftp} { <br>    putlog "reader"<br>    gets $lftp text <br>    putlog "read: $text"<br>} <br><br>proc lftp_writer {lftp} {<br>    global lftp_cmd<br>    puts $lftp $lftp_cmd<br>    set lftp_cmd ""<br>}<br><br>proc p_cmd { nick uhost handle channel text } {<br>    global lftp_cmd<br>    putlog "cmd: $text"<br>    set lftp_cmd $text<br>}<br><br>set lftp [open "|lftp" w+] <br>fconfigure $lftp -blocking 0 -buffering full<br>fileevent $lftp readable [list lftp_reader $lftp]<br>fileevent $lftp writable [list lftp_writer $lftp]<br><br>the strange think ist that after starting i got only writable events and never got a event that is readable. Even when i try in lftp_writer to read <br>something from $lftp with gets its empty <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> <br>Anyone a idea or is it simply not possible in tcl to handle complete stdin and stdout for a external program?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=509">tR</a> — Sat Jul 05, 2003 11:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-06-26T17:08:54-04:00</updated>

		<published>2003-06-26T17:08:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22609#p22609</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22609#p22609"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22609#p22609"><![CDATA[
your useing an ftp lib i gues the one from the tcl tk site  got same problem don't think it is the script but the ftplib and i have got it with all the tcl scripts that support ftp maybe use the ftp command of the shell instead<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Thu Jun 26, 2003 5:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-06-22T12:40:12-04:00</updated>

		<published>2003-06-22T12:40:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22389#p22389</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22389#p22389"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22389#p22389"><![CDATA[
Use "fileevent readable" to see when data is ready to be read. Also put the file handle in async mode with fconfigure.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Jun 22, 2003 12:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tR]]></name></author>
		<updated>2003-06-22T10:14:35-04:00</updated>

		<published>2003-06-22T10:14:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22386#p22386</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22386#p22386"/>
		<title type="html"><![CDATA[lftp problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22386#p22386"><![CDATA[
Hi, <br>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:<br><br>set fxpclient ""<br>bind pub - "!open" p_open<br>bind pub - "!ls" p_ls<br>bind pub - "!close" p_close<br><br>proc p_ls { nick uhost handle channel text } {<br>global fxpclient<br>    puts $fxpclient "ls"<br>}<br><br>proc p_close { nick uhost handle channel text } {<br>global fxpclient<br>    close $fxpclient <br>}<br><br>proc p_open { nick uhost handle channel text } {<br>global fxpclient<br>putlog "open"<br>set fxpclient [open "|lftp whatever.com:21" r+]<br>utimer 1 p_gets<br>puts $fxpclient "USER test pass"<br>putlog "open done"<br>}<br><br>proc p_gets {} {<br>global fxpclient<br>set tmp [gets $fxpclient]<br>if {[llength $tmp] &gt; 0 } {<br>    putlog "$tmp"<br>    }       <br>utimer 1 p_gets<br>}<br><br>i tried to read every second the output from lftp to show that. But this seems not the way to do that <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> someone any ideas? thanx in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=509">tR</a> — Sun Jun 22, 2003 10:14 am</p><hr />
]]></content>
	</entry>
	</feed>
