Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f9ffc5cd18d064de7e41af0dae3e8799a6671298
Ticket: 218339ffffffffffffffffffffffffffffffffff
Gripes about pipes
User & Date: nobody on 2000-10-26 00:56:25
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3985 RFE
    Version: 8.0.5
    SubmitDate: '2000-01-06'
    LastModified: '2000-01-10'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Solaris
    FixedDate: '2000-10-25'
    ClosedDate: '2000-01-10'
    
    
    Name:
    Krzysztof Kozminski
    
    DesiredBehavior:
    Did anyone ever complain that Tcl pipes don't work very well with
    processes that pass out some of their output via exit status, such
    as the unix 'diff' command?
    
    I find this example rather annoying:
    
    % open [list | diff $file1 $file2 | wc]
    file7
    % read file7
         639    3230   19434
    
    % close file7
    child process exited abnormally
    
    There is nothing abnormal here; diff exits with status 1 if it
    finds differences.  Presently, I have to do some ridiculous
    convolutions like:
    
    % open  [list | /bin/sh -c "diff '$file1' '$file2';exit 0" | wc]
    
    which work fine until I have a filename with funny characters
    in it.  Tcl pipe is much nicer in enabling me to work with
    arbitrary filenames.
    
    It would be nice to have some control over what exit status
    is considered abnormal.  Perhaps something like:
    
    pid fileId pIndex -exitok expression
    
    where pIndex would be the address of the process in the pipe,
    and expression would be a Tcl expression in which '#' would
    stand for the exit status.
    
    In my example, I would do:
    
    % open "| diff .cshrc .login | wc"
    % pid file7 0 {(# == 0) == (# == 1)}
    
    Or maybe 'close' should return a list of exit status values for
    the user to decide whether they were abnormal or not.  Something
    like:
    
    % close file7 -getexits
    1 0
    
    
    
    This RFE wants to allow for !0 exit codes to be considered
    "normal" exits, which goes against the grain of Tcl and the
    de facto standard for exit status.  We understand that there
    are a few commands in Unix which return !0 after "normal"
    execution, but these can still be handled, and as special
    cases should be. 
    -- 01/10/2000 hobbs
    
  4. foundin changed to: "final: 8.0.5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "63. (unused)"
  10. title changed to: "Gripes about pipes"
  11. type changed to: "Bug"