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.11 2009/07/17 13:58:13 grubba Exp $ + // $Id: basic.pike,v 1.12 2009/07/17 15:34:31 jonasw 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:236:   //! @param m   //! Monitor to update.   //!   //! @param st   //! New stat for the monitor.   //!   //! This function is called by @[check_monitor()] to schedule the   //! next check.   protected void update_monitor(Monitor m, Stdio.Stat st)   { -  int delta = m->max_dir_check_interval; +  int delta = m->max_dir_check_interval || max_dir_check_interval;    m->st = st;    if (!st || !st->isdir) { -  delta *= m->file_interval_factor; +  delta *= m->file_interval_factor || file_interval_factor;    }    if (st) {    int d = 1 + ((time(1) - st->mtime)>>4);    if (d < 0) d = m->max_dir_check_interval;    if (d < delta) delta = d;    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);
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:534:    if ((flags & MF_RECURSE) && (st->isdir)) {    // Check the files in the directory.    foreach(m->files, string file) {    file = Stdio.append_path(m->path, file);    Monitor m2 = monitors[file];    if (m2) {    check_monitor(m2, flags);    }    }    } -  if (m->last_change < time(1) - m->stable_time) { +  if (m->last_change < time(1) - (m->stable_time || stable_time)) {    m->last_change = 0x7fffffff;    if (stable_data_change) {    stable_data_change(m->path, st);    }    return 1;    }    return 0;   }      //! Check for changes.