Hello. i was tying to put a egg reading a file, and put the file in the channel or private windows, but the egg only read's the fisrt line, i try lot's of way's, follow wat is in the egg faq called " Basic File Operations" but i can't doint.
no, there is a } before the rest.
i am trying to read a file that exist, and work's, but only read the fist line, and not all =\
And i don't know do it =\
1: you continue even if the file doesn't exist.
2: you never open the file
3: the start/end messages are inside the loop (which I doubt is what you want)
Last edited by user on Mon Jan 03, 2005 3:35 pm, edited 1 time in total.
bind pub - !partidas pub:partidas
proc pub:partidas {nick uhost handle chan arg} {
if {![file exists partidas.txt] } { putserv "PRIVMSG $nick :Sem novas partidas"
} else {
set f [open partidas.txt]
putserv "PRIVMSG $nick :Ultimas partidas reportadas:"
while {[gets $f line]>-1} {
putserv "PRIVMSG $nick :$line"
}
putserv "PRIVMSG $nick :Para as eleminar faça !reset"
close $f
}
}
But I have only one last question, went we put close $f $f is [open (..) don't is better to put the name of the file?
like close partidas.txt or the final resut will be the same?
vodkaPT wrote:But I have only one last question, went we put close $f $f is [open (..) don't is better to put the name of the file?
like close partidas.txt or the final resut will be the same?
close expects the name of a file channel, not the name of a file. Check the manual and read up on the syntax...you'll see why the contents of 'f' is not '[open file.txt]', but what open returned (because of command substitution)