Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 29da20aee4958382b6a792462e7a5cacec92ceea
Ticket: 519868ffffffffffffffffffffffffffffffffff
[fblocked] on cmd pipe always returns 0
User & Date: krischan on 2002-02-19 11:10:51
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    starting with Tcl8.1 the fblocked command applied to
    a command pipe always returns false, even if the
    recent [read] returned less bytes than wanted.
    
    Example script:
      puts Tcl:$tcl_patchLevel
    
      set in [open "|/bin/sh -c {sleep 2; echo Hallo
    Welt}"]
      fconfigure $in -blocking 0 -translation binary
    
      while {42} {
        set bytes [read $in 11]
        if {[eof $in]} {
          close $in
          break
        }
        puts [format "read of %d bytes was %sblocked" \
               [string length $bytes] \
               [expr {[fblocked $in] ? "" : "non "}]]
        after 1100
      }
    
    Output for various Tcl versions:
      > tcl8.0.5/unix/tclsh fblocked.tcl
      Tcl:8.0.5
      read of 0 bytes was blocked
      read of 0 bytes was blocked
      read of 11 bytes was non blocked
      > tcl8.1.1/unix/tclsh fblocked.tcl
      Tcl:8.1.1
      read of 0 bytes was non blocked
      read of 0 bytes was non blocked
      read of 11 bytes was non blocked
      > tcl8.4a3/unix/tclsh fblocked.tcl
      Tcl:8.4a3
      read of 0 bytes was non blocked
      read of 0 bytes was non blocked
      read of 11 bytes was non blocked
    
    
  4. foundin changed to: "obsolete: 8.4a3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "krischan"
  9. subsystem changed to: "25. Channel System"
  10. title changed to: "[fblocked] on cmd pipe always returns 0"
  11. type changed to: "Bug"