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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Creating multiple files

Status
Not open for further replies.

amb1s1

Technical User
Nov 21, 2005
8
0
0
US
I have this problem on my script. The following is an sample of my code:

set config " config info"
set config2 " Config 2 info"

set out [open "$config.txt" a]
puts $out "$config"
.txt insert end "$config"
close $out


set out1 [open "$config1.txt" a]
puts $out1 "$config1"
.txt insert end "$config1"
close $out1


I want the script to create two file, but intead is creating one file with the name of "config", but what is write on the file is from "config1". What I'm doing wron and how can I fix it. Thanks
 
I made a typo here;

set config " config info"

set config1 " Config 1 info"

set out [open "config.txt" a]
puts $out "$config"
.txt insert end "$config"
close $out

set out1 [open "config1.txt" a]
puts $out1 "$config1"
.txt insert end "$config1"
close $out1
 
Also, when I open the file that was create, I close the file and then I'm not able to delete the file. It showing that is been used when I already close all the windows and files.
 
Is the text widget, .txt, showing what you expect it to?

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top