Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL slave interper problem with file I/O

Status
Not open for further replies.

zhuyf1225

Technical User
Nov 5, 2009
1
CN
I have a very strange problem with tcl slave interper
I use the following code to open file for writing in slave interper and it works well:
####
interp create foo
foo eval {set f [open w+]}
foo eval {puts $f "hello world"}
foo eval {close $f}
##
I can see "hello world" is written to file "But once I provide alias of "puts" in slave interper, I can't put any word to the file. The codes are following:

####
interp create foo
interp alias foo puts {} pp
proc pp {args} {}
foo eval {set f [open w+]}
foo eval {puts $f "hello world"}
foo eval {close $f}

Can anyone help me to solve this issue.
Thanks very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top