| View previous topic :: View next topic |
| Author |
Message |
kem Voice
Joined: 22 May 2004 Posts: 6
|
Posted: Sat Sep 10, 2005 12:10 pm Post subject: Open file and write. |
|
|
File:
text1
text2
| Code: |
bind dcc - test test
proc test {h i a} {
set fp [open file.txt "w"]
puts $fp "text0"
close $fp
}
|
Script add new line at end of file, what i can use to add "text0" in begin file and not delete text1 and text2 ?
(sorry for my english:>) |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Sep 10, 2005 12:51 pm Post subject: |
|
|
| read the file into a list, insert text0 at the beginning of that list, write the list to file |
|
| Back to top |
|
 |
kem Voice
Joined: 22 May 2004 Posts: 6
|
Posted: Sat Sep 10, 2005 1:42 pm Post subject: |
|
|
| simple, thx :> |
|
| Back to top |
|
 |
|