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.15 2009/07/17 16:03:50 grubba Exp $ + // $Id: basic.pike,v 1.16 2009/07/17 16:44:33 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:661:   void set_nonblocking()   {    if (co_id) return;    Monitor m = monitor_queue->peek();    int t = (m && m->next_poll - time(1)) || max_dir_check_interval;    if (t > max_dir_check_interval) t = max_dir_check_interval;    if (t < 0) t = 0;    if (backend) co_id = backend->call_out(backend_check, t);    else co_id = call_out(backend_check, t);   } +  + //! Set the @[default_max_dir_check_interval]. + void set_max_dir_check_interval(int max_dir_check_interval) + { +  if (max_dir_check_interval > 0) { +  this_program::max_dir_check_interval = max_dir_check_interval; +  } else { +  this_program::max_dir_check_interval = default_max_dir_check_interval; +  } + } +  + //! Set the @[default_file_interval_factor]. + void set_file_interval_factor(int file_interval_factor) + { +  if (file_interval_factor > 0) { +  this_program::file_interval_factor = file_interval_factor; +  } else { +  this_program::file_interval_factor = default_file_interval_factor; +  } + } +