pike.git / lib / modules / Filesystem.pmod / Monitor.pmod / basic.pike

version» Context lines:

pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1:   //   // Basic filesystem monitor.   // - // $Id: basic.pike,v 1.6 2009/07/15 13:07:08 grubba Exp $ + // $Id: basic.pike,v 1.7 2009/07/15 16:11:44 grubba Exp $   //   // 2009-07-09 Henrik Grubbström   //      //! Basic filesystem monitor.   //!   //! This module is intended to be used for incremental scanning of   //! a filesystem.      //! The default maximum number of seconds between checks of directories
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:216:      //! Calculate a suitable time for the next poll of this monitor.   protected void update_monitor(Monitor m, Stdio.Stat st)   {    int delta = m->max_dir_check_interval;    m->st = st;    if (!st || !st->isdir) {    delta *= m->file_interval_factor;    }    if (st) { -  int d = ((time(1) - st->mtime)>>4 || 1); +  int d = 1 + ((time(1) - st->mtime)>>4);    if (d < 0) d = m->max_dir_check_interval;    if (d < delta) delta = d; -  d = ((time(1) - st->ctime)>>4 || 1); +  d = 1 + ((time(1) - st->ctime)>>4);    if (d < 0) d = m->max_dir_check_interval;    if (d < delta) delta = d;    }    m->next_poll = time(1) + (delta || 1);    monitor_queue->adjust(m);   }      //! Release a single @[Monitor] from monitoring.   //!   //! @seealso