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.10 2009/07/16 14:14:20 grubba Exp $ + // $Id: basic.pike,v 1.11 2009/07/17 13:58:13 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:456:    if (file_created) {    file_created(m->path, st);    }    return 1;    }    if ((st->mtime != old_st->mtime) || (st->ctime != old_st->ctime) ||    (st->size != old_st->size)) {    m->last_change = time(1);    if (st->isdir) {    array(string) files = get_dir(m->path); -  array(string) new_files = files - m->files; -  array(string) deleted_files = m->files - files; +  array(string) new_files = files; +  array(string) deleted_files = ({}); +  if (m->files) { +  new_files -= m->files; +  deleted_files = m->files - files; +  }    m->files = files;    foreach(new_files, string file) {    file = Stdio.append_path(m->path, file);    Monitor m2 = monitors[file];    mixed err = catch {    if (m2) {    // We have a separate monitor on the created file.    // Let it handle the notification.    check_monitor(m2, flags);    }