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.36 2010/02/03 15:24:41 grubba Exp $ + // $Id: basic.pike,v 1.37 2010/04/27 14:58:11 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:350:    //! Called to create a sub monitor.    protected void monitor(string path, int flags, int max_dir_interval,    int file_interval_factor, int stable_time)    {    global::monitor(path, flags, max_dir_check_interval,    file_interval_factor, stable_time);    }       //! Called when the status has changed for an existing file.    protected int(0..1) status_change(Stdio.Stat old_st, Stdio.Stat st, -  int orig_flags) +  int orig_flags, int flags)    {    if (st->isdir) {    array(string) files = get_dir(path) || ({});    array(string) new_files = files;    array(string) deleted_files = ({});    if (this_program::files) {    new_files -= this_program::files;    deleted_files = this_program::files - files;    }    this_program::files = files;
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:561:    }    }    }    return 1;    } else {    return 0;    }    if ((st->mtime != old_st->mtime) || (st->ctime != old_st->ctime) ||    (st->size != old_st->size)) {    last_change = time(1); -  if (status_change(old_st, st, orig_flags)) return 1; +  if (status_change(old_st, st, orig_flags, flags)) return 1;    }    if ((flags & MF_RECURSE) && (st->isdir)) {    // Check the files in the directory.    foreach(files, string file) {    file = canonic_path(Stdio.append_path(path, file));    Monitor m2 = monitors[file];    if (m2) {    m2->check(flags);    }    }