egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Open file and write.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
kem
Voice


Joined: 22 May 2004
Posts: 6

PostPosted: Sat Sep 10, 2005 12:10 pm    Post subject: Open file and write. Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Sep 10, 2005 12:51 pm    Post subject: Reply with quote

read the file into a list, insert text0 at the beginning of that list, write the list to file
Back to top
View user's profile Send private message Visit poster's website
kem
Voice


Joined: 22 May 2004
Posts: 6

PostPosted: Sat Sep 10, 2005 1:42 pm    Post subject: Reply with quote

simple, thx :>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber