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.

Writting a new line in a file using "puts"

Old posts that have not been replied to for several years.
Locked
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Writting a new line in a file using "puts"

Post by Gothic-Angel »

Code: Select all

bind notc - "*\[VERBOSE\]*" verbose
 
 proc verbose {nick uhost hand text dest} {
 putlog "Verbose logged by $nick and was $text"

set file "verb.txt"
set fs [open $file w]
puts $fs "$nick $text"
close $fs
}
Ok well so far so good, however in verb.txt it only writes to line 1 and overwrites anything in line 1. So I only see the last thing done. Id like for it to log each one to a seperate line.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

Code: Select all

bind notc - "*\[VERBOSE\]*" verbose 

proc verbose {nick uhost hand text dest} { 
putlog "Verbose logged by $nick and was $text" 

set file "verb.txt" 
set fs [open $file a+] 
puts $fs "$nick $text" 
close $fs 

Ok works fine now, heheh This logs Verbose to Verb.txt
Locked