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

version» Context lines:

pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:838:   }      //! Inotify-accellerated @[Monitor].   protected class InotifyMonitor   {    inherit Monitor;       protected int wd = -1;    int `accellerated() { return wd != -1; }    +  protected void file_exists(string path, Stdio.Stat st) +  { +  ::file_exists(path, st); +  if ((last_change != 0x7fffffff) && (wd != -1)) { +  // Not stable yet. +  int t = time(1) - last_change; +  if (t < 0) t = 0; +  (backend || Pike.DefaultBackend)-> +  call_out(check, (stable_time || global::stable_time) + 1 - t); +  } +  } +  +  protected void file_created(string path, Stdio.Stat st) +  { +  if (wd != -1) { +  (backend || Pike.DefaultBackend)-> +  call_out(check, (stable_time || global::stable_time) + 1); +  } +  ::file_created(path, st); +  } +  +  protected void attr_changed(string path, Stdio.Stat st) +  { +  if (wd != -1) { +  (backend || Pike.DefaultBackend)-> +  call_out(check, (stable_time || global::stable_time) + 1); +  } +  ::attr_changed(path, st); +  } +     protected void register_path(int|void initial)    {    if (wd != -1) return;       if (initial && !instance) {    MON_WERR("Creating Inotify monitor instance.\n");    instance = System.Inotify._Instance();    file = Stdio.File();    if (backend) file->set_backend(backend);    file->assign(instance->fd());