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

version» Context lines:

pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:989:    // We've missed creation of the submonitor.    //    // This can happen in the    //    // Exist ==> Deleted ==> Exists    //    // with no update of the directory inbetween race-condition.    //    // Create the submonitor.    MON_WARN("Monitor lost for path %O.\n", full_path); -  monitor(full_path, m->flags | MF_AUTO | MF_HARD, +  m = monitor(full_path, m->flags | MF_AUTO | MF_HARD,    m->max_dir_check_interval,    m->file_interval_factor,    m->stable_time); -  m = monitors[full_path]; -  m->check(0); // Init monitor. +  // monitor() will not register monitor for path if filter_file() +  // returns 0. +  if (m) { +  m->check(0); // Init monitor.    }    }    } -  +  }       if (m) {    if (event == System.Inotify.IN_IGNORED) {    // This Inotify watch has been removed    // (either by us or automatically).    MON_WERR("### Monitor watch descriptor %d is no more.\n", wd);    m_delete(monitors, icookie);    }    mixed err = catch {    if (event & System.Inotify.IN_CLOSE_WRITE)
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1318:   //! @param file_interval_factor   //! Override of @[default_file_interval_factor] for this path   //! or subtree.   //!   //! @param stable_time   //! Override of @[default_stable_time] for this path   //! or subtree.   //!   //! @seealso   //! @[release()] - void monitor(string path, MonitorFlags|void flags, + Monitor|void monitor(string path, MonitorFlags|void flags,    int(0..)|void max_dir_check_interval,    int(0..)|void file_interval_factor,    int(0..)|void stable_time)   {    path = canonic_path(path);    if(filter_file(path)) return;    Monitor m = monitors[path];    if (m) {    if (!(flags & MF_AUTO)) {    // The new monitor is added by hand.
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1349:    }    // For the other cases there's no need to do anything,    // since we can keep the monitor as-is.    } else {    m = monitor_factory(path, flags, max_dir_check_interval,    file_interval_factor, stable_time);    monitors[path] = m;    // NB: Registering with the monitor_queue is done as    // needed by register_path() as called by create().    } +  return m;   }      int filter_file(string path)   {    array x = path/"/";    foreach(x;; string pc)    if(pc && strlen(pc) && pc[0]=='.' && pc != "..") {    MON_WERR("skipping %O\n", path);    return 1;    }