| View previous topic :: View next topic |
| Author |
Message |
Saibot Voice
Joined: 23 Aug 2010 Posts: 3
|
Posted: Tue Aug 24, 2010 4:32 pm Post subject: exec/log and strange error |
|
|
I wrote this script:
| Code: | bind pub o .shutdown shutdown
bind pub o .run run
set logfile "logs/exec/beehive.log"
set log [open $logfile a]
proc shutdown { nick uhost handle chan text } {
global log logfil
# set docmd [exec ./shutbeehive]
putserv "PRIVMSG $chan :\0034Beehive is shutting down... \003"
puts $log "$nick\n[strftime "%Y %b %d %a %T"]:\n Shutdown"
}
proc run { nick uhost handle chan text } {
global log logfil
#set docmd [exec ./runbeehive]
putserv "PRIVMSG $chan :\0034Beehive is starting...please wait. \003"
puts $log "$nick\n[strftime "%Y %b %d %a %T"]:\n Start"
}
close $log
|
but i have a very strange error:
| Code: | | Tcl error [run]: can not find channel named "file14" |
if i use the .shutdown i have same problem.
i dont understand what is it.
pls help me. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Aug 24, 2010 5:19 pm Post subject: |
|
|
Rather obviously, you close the file handle (aka channel) right after you open it.. Thus it is no longer open for write-access when you call either of the two commands. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|