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.
Old posts that have not been replied to for several years.
w
woffer
Post
by woffer » Tue Jun 11, 2002 4:50 pm
i need a help with a script (duh!)
the script is supposed to open 2 files with "tailf -f" or some eggdrop/tcl built-in function, and check each line in a if,
now to the problem, woun't the bot freeze all it's other functions while checking the files?
Petersen
Owner
Posts: 685 Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK
Post
by Petersen » Tue Jun 11, 2002 6:06 pm
it would if you used exec tail -f, exec is a blocking function.
w
woffer
Post
by woffer » Tue Jun 11, 2002 6:41 pm
any other way then exec? that woun't lock it ?
<font size=-1>[ This Message was edited by: woffer on 2002-06-11 16:42 ]</font>
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Fri Jun 14, 2002 9:22 am
No.
Eggdrop is not threaded, and thus, it has to block/freeze to perform the action.
It all depends what the script/exec will be doing. As you maybe able to speed things up, without the use of tailf.
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Sun Jun 16, 2002 7:29 am
You can do it 2 ways. You can either use a pipe instead of exec (read the 'open' command) and use non-blocking io on the pipe (see 'filevent').
Or you can write the whole thing in Tcl (use the 'file' command to monitor the access time, then just seek to the end and get the new data).
w
woffer
Post
by woffer » Mon Jun 17, 2002 4:36 pm
Thanks for the help, but i solved it in another weird way
learned C and coded my own crapy bot (with threads) just for this function