This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Open file and write.

Old posts that have not been replied to for several years.
Locked
k
kem
Voice
Posts: 6
Joined: Sat May 22, 2004 11:25 am

Open file and write.

Post by kem »

File:
text1
text2

Code: Select all

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:>)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

read the file into a list, insert text0 at the beginning of that list, write the list to file
k
kem
Voice
Posts: 6
Joined: Sat May 22, 2004 11:25 am

Post by kem »

simple, thx :>
Locked