Problem with close function in routine using pipe 
Author Message
 Problem with close function in routine using pipe

I am currently developing a user interface to several
processes that run on AIX3.2.5.  Currently using tcl7.5a2
and tk4.1a2.  The problem is I get an error message from
the following procedure

proc read_pipe { command } {
   set data ""
   set fileid [open $command r]
   if { $fileid != "" } {
      set data [read $fileid]
      close $fileid
   return $data


When called as a stand-alone by:
 read_pipe "|fujibin -m CP3 -n new.file old.file"
the following output is received (expected)
 Processing file - old.file

However, when the command is executed within a tcl script
an error is generated with the following log:
 Processing file - old.file
      while executing
 "close $fileid"
      invoked from within
 "if { $fileid != "" } {
     set data [read $fileid]
     close $fileid

The error is associated with the close command.

Any help would be greatly appreciated.

Fri, 31 Jul 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. pipe.close -> Broken pipe/DRb madness

2. Using search tool on function or control pallette causes Labview to close

3. problem defining a function using built in filter function

4. problem using using list with function

5. Problem using pipe()

6. expect: problem using a pipe as stdin

7. Problems with close command when using expect

8. Closing output pipes

9. Problem using BLAS routines

10. win32: Pipes opened with popen3 cant be closed!

11. closing pipes: error status

12. Unable to close pipe


Powered by phpBB® Forum Software