Re: Events on Serial port



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]} {
...
.



Relevant Pages

  • Re: scanf (yes/no) - doesnt work + deprecation errors scanf, fopen etc.
    ... C standard allows, but in C89 at least does not require, EOF to be ... Control-D might be the character that you enter to ... trigger and end-of-file condition, which will then cause getcharto ... The way an end-of-file condition is triggered ...
    (comp.lang.c)
  • RE: Problem in using trigger
    ... If you posted DDL (Create table, Create Trigger ... Your AutoRs recordset does not ... > Which is currently EOF ... > I Mean to say boththe statments are executed. ...
    (microsoft.public.sqlserver.programming)
  • Re: EOF question
    ... > The program should read input characters until it hits an EOF ... How that EOF condition is triggered is system-specific. ... > should be able to trigger and EOF by entering control-Z on a line by ...
    (comp.lang.c)
  • Re: EOF question
    ... The program should read input characters until it hits an EOF ... How that EOF condition is triggered is system-specific. ... should be able to trigger and EOF by entering control-Z on a line by ...
    (comp.lang.c)
  • Re: Dynamically loading procs?
    ... Ralf Fassel wrote: ... This statement will almost always be true, since the only reason for ... the catch to trigger would be the $workingDir variable not being ... I put the catch in because the directory "jacl/proclib" may not exist. ...
    (comp.lang.tcl)