Deutsch   English   Français   Italiano  
<103ma6s$6t7d$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Christian Gollwitzer <auriocus@gmx.de>
Newsgroups: comp.lang.tcl
Subject: Re: Event loop and http::geturl
Date: Fri, 27 Jun 2025 16:35:08 +0200
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <103ma6s$6t7d$1@dont-email.me>
References: <103cf0h$1glgk$1@dont-email.me> <103d93c$1q263$1@dont-email.me>
 <103dm05$1svqt$1@dont-email.me> <103ffab$2b701$1@dont-email.me>
 <103g70o$2k78v$1@dont-email.me> <103gdlo$2lnei$1@dont-email.me>
 <103hem3$2ua8s$1@dont-email.me> <103hptq$30q4s$1@dont-email.me>
 <103i951$33lgp$1@dont-email.me> <103juqc$3imgb$1@dont-email.me>
 <103k5sj$3kaj3$1@dont-email.me> <103kcha$3ll1r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 27 Jun 2025 16:35:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4f71755d053f21f19bd8969f9259efad";
	logging-data="226541"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/LevxlAuauEN5yAT5noS3hWMLA5f9lOZQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:GvSiLXOwgqIeIp2q5RNfYS+DucY=
In-Reply-To: <103kcha$3ll1r$1@dont-email.me>

Am 26.06.25 um 23:02 schrieb et99:
> I wonder, if you are reading a file that is being written from another 
> process, sort of like a "tail" program, doesn't tcl's [fileevent 
> <channel> readable <script>] trigger constantly? Isn't this in effect a 
> tight polling loop?

The underlying mechanism is select() or poll(). To my knowledge, this 
only works for pipes/sockets, not for files. The "tail -f" program runs 
stat() in a loop to see if the file date or size has changed.

On Linux, you could also use inotify (there is a Tcl package) to get 
callbacks when the file is changed

      Christian