Re: Events on Serial port
- From: claird@xxxxxxxxx (Cameron Laird)
- Date: Fri, 4 Jul 2008 00:16:04 +0000
In article <yga7ic2vlxt.fsf@xxxxxxxxxxxxxxxxxxxxxxxx>,
Ralf Fassel <ralfixx@xxxxxx> wrote:
.
.
.
proc read_data {fd} {.
if {[eof $fd]} {
close $fd
return
}
set bytes [read $fd]
.
.
Ralf, if I understand the situation correctly, this
is a slightly misleading, if functional, expression.
My point is this: it takes a [read] BEFORE [eof]
can trigger. To me, therefore, the most maintainable
code is more like
...
set bytes [read $fd]
if {[eof $fd]} {
...
.
- Follow-Ups:
- Re: Events on Serial port
- From: Ralf Fassel
- Re: Events on Serial port
- References:
- Events on Serial port
- From: Derek
- Re: Events on Serial port
- From: Rolf Schroedter
- Re: Events on Serial port
- From: Derek
- Re: Events on Serial port
- From: Ralf Fassel
- Events on Serial port
- Prev by Date: Re: Events on Serial port
- Next by Date: Re: after ids
- Previous by thread: Re: Events on Serial port
- Next by thread: Re: Events on Serial port
- Index(es):
Relevant Pages
|