Go Back   FlashFXP Forums > > > >

! Other Scripts Support Support for all other scripts...

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-09-2005, 01:49 PM   #1
oslike
Member
 
Join Date: Dec 2003
Posts: 90
Default TCL scripting advice needed

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
oslike is offline   Reply With Quote
Old 08-10-2005, 05:06 AM   #2
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default

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...
FTPServerTools is offline   Reply With Quote
Old 08-11-2005, 08:24 AM   #3
oslike
Member
 
Join Date: Dec 2003
Posts: 90
Default read backwards

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 is offline   Reply With Quote
Old 08-11-2005, 09:09 AM   #4
oslike
Member
 
Join Date: Dec 2003
Posts: 90
Default

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 is offline   Reply With Quote
Reply

Tags
file, log, read, site, tcl

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:05 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)