Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: af3405ddeefdfdc17b9058a7e5aadf9c18ca1faf
Ticket: 1995063fffffffffffffffffffffffffffffffff
Doc: example in fileevent manpage is bad.
User & Date: ferrieux on 2008-06-16 21:06:59
Changes

  1. icomment:
    Logged In: YES 
    user_id=496139
    Originator: NO
    
    ad Andreas: huh ?
    
    > fileevent-callbacks are also fired when previous gets 
    > returned with no eof-condition, but the channel died 
    > afterwards on peer's behalf
    
    This is just plain wrong.
    [eof] is not updated until a read operation has been tried.
    To convince yourself of this:
    
        set n [open /dev/null r] ;# works with NUL: on Windows too
        fileevent $n readable {puts stderr EOF:[eof $n];close $n}
      => EOF:0
    
    Hence the idiom proposed by Donal which is minimal, accurate (no extra empty line), and syscall-efficient ([eof] only reads memory).
    
    
    
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"