Posted to tcl by rmax at Thu Aug 04 07:45:21 GMT 2022view raw

  1. lassign [chan pipe] r w
  2. chan configure $r -blocking 0 -translation binary
  3. chan configure $w -buffering line -translation crlf -buffersize 8
  4. puts $w xxxxxxx
  5. set data [read $r 10]
  6. switch -- $data {
  7. "xxxxxxx\r" {puts "reproduced the bug"}
  8. "xxxxxxx\r\n" {puts "bug fixed"}
  9. default {puts "unexpected result"}
  10. }
  11.