Originally Posted By: hixxy
Don't you know anything about /filter at all? AT ALL? I find it SO frustrating people don't understand what is truly a basic concept.

Code:
alias filetest {
  if (%filetest.lastfpos !isnum) {
    set %filetest.lastfpos 1
  }
  var %file = $qt($1-), %lines = $lines($1-)
  if (%filetest.lastfpos == %lines) return
  filter -rfk $+(%filetest.lastfpos,-,%lines) %file _filetest
  set %filetest.lastfpos %lines
}
alias -l _filetest {
  if ($1-) echo -a $1-
}


Consistently performs twice as fast as the file handling method smile
Oh yeah, less code too.


/fseek takes no time at all. Like 0 ms to move to any position in the file. Regardless of size. /filter has to read the entire file every time. And you use $lines which also reads the entire file.

What my alias does is read thru the file the first time, then stores the file pointer position at the current end of the file. Each subsequent time, it then attempts to read the file starting where the file ended the prior time. If the file hasn't changed, it reads nothing, and the file position stays the same. If the file has been appended with new data, it reads up to the new data and stores the new position of the file pointer.

The amount of code is irrelevant. And why did you change the subject? I shouldn't even be responding to this. But you've distorted what I stated. Hixxy, fseek is a low level operation. One that mIRC itself performs. The /fseek command basically

Last edited by MeStinkBAD; 21/07/10 07:32 AM.