Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d6af7fb40e25d8deccdcf3b49eda16eb9a5978e9
Ticket: 792990ffffffffffffffffffffffffffffffffff
Redirect file output into variables
User & Date: elfring on 2003-08-22 20:36:30
Changes

  1. icomment:
    Logged In: YES 
    user_id=572001
    
    1. Open  a new file with the option that all data is written to 
    or read from a TCL variable
    Example:
    if {![catch {open -var Debug stdout w} File]} \
     {
      # Some code to check in a "special" execution environment
    
      # Do something...
       puts "Surprise"
    
      # Work is done.
      close $File
    
      LogResult $Debug
     }
    
    
    2. Catch a part of file processing
    Example:
    fconfigure -setvar Debug stdout
    
    # Do something...
    puts "Surprise"
    
    fconfigure -stopvar Debug stdout
    LogResult $Debug
    
    # Display message to the normal target
    puts "finished"
    
    if [file isbuffering stdout] \
     {
      fconfigure -getcontents Buffer stdout
      LogResult $Buffer
     }
    
    
    Is this little explanation useful?
    
    
  2. login: "elfring"
  3. mimetype: "text/plain"
  4. username: "elfring"