<?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/19758" />

	<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>2014-08-02T18:44:54-04:00</updated>

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

		<entry>
		<author><name><![CDATA[downloaded]]></name></author>
		<updated>2014-08-02T18:44:54-04:00</updated>

		<published>2014-08-02T18:44:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103112#p103112</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103112#p103112"/>
		<title type="html"><![CDATA[Exec help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103112#p103112"><![CDATA[
Took me some time to get there... But i did. For future owners searching for this here it is.<br><br>The simplest way is to use bgexec scripts. I used <a href="http://forum.egghelp.org/viewtopic.php?p=100611" class="postlink">the one caeser posted</a>, but there are others online.<br><br>To launch your code use:<br><div class="codebox"><p>Code: </p><pre><code>bgexec "lftp -f script.txt" callback</code></pre></div>To catch the response from lftp use:<br><div class="codebox"><p>Code: </p><pre><code>proc callback {input} {foreach line [split $input "\n"] {putlog "$line"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12416">downloaded</a> — Sat Aug 02, 2014 6:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[downloaded]]></name></author>
		<updated>2014-07-30T15:00:53-04:00</updated>

		<published>2014-07-30T15:00:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103096#p103096</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103096#p103096"/>
		<title type="html"><![CDATA[Exec help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103096#p103096"><![CDATA[
Tks for your help caesar.<br><br>Following you hint i came this far:<br><div class="codebox"><p>Code: </p><pre><code>set lftpexe [open "|lftp -f script.txt"]fconfigure $lftpexe -blocking 0fileevent $lftpexe readable [list lftpcallback $lftpexe]proc lftpcallback {lftpexe} {putlog "Reader"gets $lftpexe splineputlog "Read: $spline"}</code></pre></div>Its not working since i get like 10 "Reader" and "Read:" in each second and after a while the lftp process appears as "defunct". From what i understood it means there's something to be read before the precess ends.<br><br>I think i may need to close channel inside lftpcallback, but didnt have the time to test it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12416">downloaded</a> — Wed Jul 30, 2014 3:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2014-07-30T05:08:33-04:00</updated>

		<published>2014-07-30T05:08:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103093#p103093</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103093#p103093"/>
		<title type="html"><![CDATA[Exec help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103093#p103093"><![CDATA[
3rd option my guess would be to use fileevent with a callback to another proc. <br><br>Anyway, I haven't done this before but I recall there was a topic regarding the same issue, like <a href="http://forum.egghelp.org/viewtopic.php?p=100611" class="postlink">this one</a>. Or you could search the forum with <em class="text-italics">fileevent</em> as keyword.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Jul 30, 2014 5:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[downloaded]]></name></author>
		<updated>2014-07-30T04:45:53-04:00</updated>

		<published>2014-07-30T04:45:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103092#p103092</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103092#p103092"/>
		<title type="html"><![CDATA[Exec help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103092#p103092"><![CDATA[
I've been coding a script to transfer some files using lftp. Lftp is launched with exec. From what i searched in this forum seems i have two options:<br><br>1- Run exec and wait for transfer to finish and get a sucess return code or failed. In the meanwhile the eggdrop stops responding and if the transfer takes long enough it will timeout from IRC.<br><br>2- Run exec in the backgroud and forget about any sucess confirmation or error handling.<br><br>Is there a 3rd option?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12416">downloaded</a> — Wed Jul 30, 2014 4:45 am</p><hr />
]]></content>
	</entry>
	</feed>
