PDA

View Full Version : TCL scripting advice needed


oslike
08-09-2005, 01:49 PM
Hi all,


i am writing a "site new" script with TCL (had a look at ioNEWDIR.tcl) and have the following problem:

i am trying to read new created folders from IOFTPD.log.
My log file is around 6MB and my "site new" command seems to
take up to 20 seconds, sometimes its faster i think because
its cached then.

Is there a way to fasten this? (Besides rotating logs every day)

Maybe a way to open LOG file and read it backward till it gets the last 50 new files?

Does any1 have an idea?

thanks in advance

os-like

FTPServerTools
08-10-2005, 05:06 AM
Well how about not reading from the beginning to the end but from the end backwards? Or how about remembering where you were (file offset) after the first good attempt and only reading from there? All you then would need to do is find take care that if the log gets reset/deleted that you update the counter as well.. Quite simple...

oslike
08-11-2005, 08:24 AM
Thanks for reply,

i am just new to TCL, can you give me a hint of how to read the log backwards in pseudo code?
Would appreciate that alot.

Maybe you know whats the fastest "site new" script around?

i think all scripts that are LOGbased (ioftpd.log or newdirs.log) are of the same speed O(n).
I checked NEOXed tools it seems he implemented "site new" with a SQL database which is the faster or maybe pastetst than O(n) ... any ideas on it ?

os-like

oslike
08-11-2005, 09:09 AM
Thanks for reply,

i am just new to TCL, can you give me a hint of how to read the log backwards in pseudo code?
Would appreciate that alot.

Maybe you know whats the fastest "site new" script around?

i think all scripts that are LOGbased (ioftpd.log or newdirs.log) are of the same speed O(n).
I checked NEOXed tools it seems he implemented "site new" with a SQL database which is the faster or maybe pastetst than O(n) ... any ideas on it ?

os-like