🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.tcl
Article #178

Re: obsluga buttona z bardzo dlugim czasem realizacji powiazanego z nim polecenia

#178
From: Googie
Date: Fri, 30 Sep 2005 14:19
26 lines
1593 bytes
Marcin Szelest SQ9DJJ napisał(a):
> Ludzie ratujcie bo sie zaraz przekrece!!

Trzeba użyć strumieni, zamiast standardowego execa. Strumienie nie 
blokują wykonywania/odświerzania bierzącego skryptu, ale wymagają nieco 
więcej oprogramowywania. Oto przykład, jak zapisać:

puts [exec polecenie argument1 argument2]

używając strumieni:

proc handlePolecenie {id} {
	set data [read $id]
         puts $data
         if {[eof $id]} {
		# [catch] użyte tak dla pewności.
		catch {close $id}
	}
}
set id [open "|polecenie argument1 argument2" r]
fileevent $id readable "handlePolecenie $id"


-- 
Pozdrawiam!
Googie
Technical Details
Message-ID: <dhjh8q$a3h$1@srv.cyf-kr.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!feed.news.interia.pl!news.cyf-kr.edu.pl!not-for-mail
References: <op.sxw2d3dfhxnnvd@szelest.gliwice.evatronix.com.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!feed.news.interia.pl!news.cyf-kr.edu.pl!not-for-mail
From: Googie <no@spam.org>
Newsgroups: pl.comp.lang.tcl
Subject: Re: obsluga buttona z bardzo dlugim czasem realizacji powiazanego z nim polecenia
Date: Fri, 30 Sep 2005 16:19:18 +0200
Organization: Academic Computer Center CYFRONET AGH
Lines: 26
Message-ID: <dhjh8q$a3h$1@srv.cyf-kr.edu.pl>
References: <op.sxw2d3dfhxnnvd@szelest.gliwice.evatronix.com.pl>
NNTP-Posting-Host: tatanka.veranet.pl
Mime-Version: 1.0
X-Trace: srv.cyf-kr.edu.pl 1128089690 10353 195.214.216.6 (30 Sep 2005 14:14:50 GMT)
X-Complaints-To: news@cyf-kr.edu.pl
NNTP-Posting-Date: Fri, 30 Sep 2005 14:14:50 +0000 (UTC)
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: pl, en-us, en
In-Reply-To: <op.sxw2d3dfhxnnvd@szelest.gliwice.evatronix.com.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit