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.27 2009/10/13 12:39:20 grubba Exp $ + // $Id: basic.pike,v 1.28 2009/10/19 14:23:45 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:283:    }    // Signal file_exists for path as an end marker.    if (file_exists) {    file_exists(path, st);    }    }    return 1;    }    if (!st) {    if (old_st) { +  int delay; +  // Propagate deletions to any submonitors. +  if (files) { +  foreach(files, string file) { +  file = canonic_path(Stdio.append_path(path, file)); +  if (monitors[file]) { +  // Adjust next_poll, so that the monitor will be checked soon. +  monitors[file]->next_poll = time(1)-1; +  monitor_queue->adjust(monitors[file]); +  delay = 1; +  } +  } +  } +  if (delay) { +  // Delay the notification until the submonitors have notified. +  st = old_st; +  next_poll = time(1); +  monitor_queue->adjust(this); +  } else {    if (this_program::flags & MF_AUTO) {    m_delete(monitors, path);    release_monitor(this);    }    if (file_deleted) {    file_deleted(path);    }    return 1;    } -  +  }    return 0;    }    if (!old_st) {    last_change = time(1);    if (file_created) {    file_created(path, st);    }    return 1;    }    if ((st->mtime != old_st->mtime) || (st->ctime != old_st->ctime) ||