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

	<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-09-05T08:43:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-09-05T08:43:26-04:00</updated>

		<published>2003-09-05T08:43:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26553#p26553</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26553#p26553"/>
		<title type="html"><![CDATA[Non I/O Blocking exec replacement ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26553#p26553"><![CDATA[
<blockquote class="uncited"><div>is it possible to use open the way i just told ?</div></blockquote>Yes. By using 'fconfigure' to make it non-blocking and 'fileevent readable' to set up the callback. The only thing that is a bit tricky is redirection of stderr...i'll get back to you on this...try this code:<div class="codebox"><p>Code: </p><pre><code>proc myexec {cmd callback} {set f [open |$cmd r+]fconfigure $f -blocking 0fileevent $f readable [list myexecIn $f $callback]set f}proc myexecIn {f callback} {if {[set i [gets $f line]]&gt;0} {uplevel #0 [concat $callback [list $line]]} elseif {$i==-1} {close $fuplevel #0 [concat $callback {{}}]}}</code></pre></div>The callback command will be called for each line of output. Blank lines are ignored and when the process ends the callback command is called with a blank argument - like a dcc connection put under control under eggdrop. (the callback can be a list of command+arguments just like the built in callbacks.) This code is by no means final, but it's something to start with <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Sep 05, 2003 8:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-09-05T08:29:59-04:00</updated>

		<published>2003-09-05T08:29:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26548#p26548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26548#p26548"/>
		<title type="html"><![CDATA[Non I/O Blocking exec replacement ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26548#p26548"><![CDATA[
<blockquote class="uncited"><div>why not open |?</div></blockquote>is it possible to use open the way i just told ? (seriouse question, i really dont know)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Fri Sep 05, 2003 8:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-09-05T07:13:16-04:00</updated>

		<published>2003-09-05T07:13:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26540#p26540</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26540#p26540"/>
		<title type="html"><![CDATA[Non I/O Blocking exec replacement ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26540#p26540"><![CDATA[
why not open |?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Sep 05, 2003 7:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-09-05T06:48:19-04:00</updated>

		<published>2003-09-05T06:48:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=26538#p26538</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=26538#p26538"/>
		<title type="html"><![CDATA[Non I/O Blocking exec replacement ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=26538#p26538"><![CDATA[
Is there some module out there that replaces the exec cmd with a non blocking one ? (no, i dont mean bgexec or open) ?<br><br>like for example<br>set outfile [myexec "ping $host" ping_get]<br>and each time this exec sends a new line -&gt; it gets sent to ping_get<br><br>maybe one of the coders in here can realize this idea..my own C / C++ skills are too low for this<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Fri Sep 05, 2003 6:48 am</p><hr />
]]></content>
	</entry>
	</feed>
