Posted to tcl by none at Thu Jan 28 09:25:12 GMT 2010view raw

  1. proc readdata {filechannel} {puts [gets $filechannel]}
  2.  
  3.  
  4. catch {[exec /bin/mknod file_a p]} hgfcdwehb
  5. set filechannel [open file_a {RDONLY}]
  6. fconfigure $filechannel -blocking 0 -buffering line
  7. fileevent $filechannel readable [readdata $filechannel]
  8. vwait forever
  9.  
  10.  
  11. #another process will be writing lines to the file: open, puts, flush, close