Build the function to call when the file changes
777275
function() {
      FS.readFile(path, options.encoding, function(err, text) {
        if (err) {
          // Forward the error
          return callback(err);
        }
        // Success
        callback(null, text.toString());
      });
    }
1156439
function(event, path) {
            emitter.emit("file:changed", {
                event: event,
                path: path,
                namespace: namespace
            });
        }
195592
def callback(self, filename, lines, **kwargs):
        """"""
        timestamp = self.get_timestamp(**kwargs)
        if kwargs.get('timestamp', False):
            del kwargs['timestamp']
        

        for line in lines:
            try:
                import warnings
                with warnings.catch_warnings():
                    warnings.simplefilter('error')
                    m = self.format(filename, line, timestamp, **kwargs)
                    self.logger.debug("Sending message " + m)
                    self.conn.send(destination=self.queue, body=m)    

            except Exception, e:
                self.logger.error(e)
                try:
                    raise TransportException(e)
                except AttributeError:
                    raise TransportException('Unspecified exception encountered')
234905
def trigger_modified(self, filepath):
        """"""
        mod_time = self._get_modified_time(filepath)
        if mod_time > self._watched_files.get(filepath, 0):
            self._trigger('modified', filepath)
            self._watched_files[filepath] = mod_time
1196963
function refresh(file, event, full) {
      views.forEach(function loopViews(path) {
        if (path !== full) return;

        tempers.forEach(function eachTemper(temper) {
          delete temper.file[path];
          delete temper.compiled[path];

          temper.prefetch(path);
        });
      });

      assets.forEach(function loopAssets(path) {
        if (path !== full) return;

        bigpipe.compiler.put(path);
      });

      bigpipe.emit('change', file, event, full);
      console.log([
        '[watch] detected content changes --'.blue,
        file.white,
        'changed'.white
      ].join(' '));
    }
398120
def build_stack_changes(stack_name, new_stack, old_stack, new_params,
                        old_params):
    """"""
    from_file = "old_%s" % (stack_name,)
    to_file = "new_%s" % (stack_name,)
    lines = difflib.context_diff(
        old_stack, new_stack,
        fromfile=from_file, tofile=to_file,
        n=7)  # ensure at least a few lines of context are displayed afterward

    template_changes = list(lines)
    log_lines = []
    if not template_changes:
        log_lines.append("*** No changes to template ***")
    param_diffs = diff_parameters(old_params, new_params)
    if param_diffs:
        log_lines.append(format_params_diff(param_diffs))
    if template_changes:
        log_lines.append("".join(template_changes))
    return log_lines
1139094
function watch(arg_src_dir)
{
	console.info('Watching for change on: ' + arg_src_dir)
	
	const watch_settings = { ignored: /[\/\\]\./, persistent: true }
	var watcher = chokidar.watch(arg_src_dir, watch_settings)
	watcher.on('change', reload_file)
	
	return watcher
}
244325
function(params, options) {
      var t = this;

      // If raw text was sent to the template, compile and return
      if (t.get('text')) {
        t.compile();
        return;
      }

      // Watch for changes in the text element
      t.on('change:text', t.compile, t);

      // Process a file template
      var path = t.get('path');
      if (path) {
        // Load the file
        if (t.asyncLoad) {
          FS.readFile(path, function(err, text) {
            if (err) {
              return console.error('Error reading file: ' + path, err);
            }
            t.set({text: text.toString()});
          });
        } else {
          t.set({text: FS.readFileSync(path).toString()});
        }

        // Watch the file for changes
        if (t.get('watchFile')) {
          t._watchFile();
        }
      }
    }
1330178
def if_file_changed(file, &block)
      if_string_changed(file, Digest::SHA256.file(file).hexdigest.to_s, &block)
    end
532988
def configfile(f):
    

    @click.pass_context
    def new_func(ctx, *args, **kwargs):
        ctx.config = yaml.load(open(ctx.obj["configfile"]))
        return ctx.invoke(f, *args, **kwargs)

    return update_wrapper(new_func, f)
868439
function watchChanges(io, params) {
    const folder = process.cwd();
    return watch(folder, { recursive: true }, () => {
        emitInfo('changes detected. Recompiling...');
        io.sockets.emit('load');
        const start = new Date().getTime();
        executeWithParams(params)
            .tap(alerts => {
                const ellapsed = new Date().getTime() - start;
                emitSuccess(`wow! recompiled and executed in ${ellapsed}ms!`);
                io.sockets.emit('update', compileMarkdown(alerts));
            })
            .catch(err => {
                emitError(`hot compilation error, baby: ${err.message}`);
                io.sockets.emit('failure', err.stack);
            });
    });
}
751693
def script_file_changed(path)
      Ichiban.logger.script_run(path)
      script = Ichiban::Script.new(path).run
    end
178012
protected function onFileChanged()
    {
        $this->firstLinesRaw = null;
        $this->firstLines = null;
        if ($this->separatorWasDetected) {
            $this->separator = '';
            $this->separatorWasDetected = false;
        }
        if ($this->headerWasDetected) {
            $this->setHeader([]);
            $this->headerWasDetected = false;
        }
    }
812509
function onFileChanged(event) {
		if(event && event.type === 'Changed' && Array.isArray(event.modified)) {
			//event = {type, files: [{name, location, metadata: {contentType}}]}
			event.modified.forEach(function(file) {
				if(typeof file === 'string') {
					_cache.remove(_getKey(file));
				}
			});
		}
	}
497281
function () {
        function checkUpdate() {
            var current = module.exports.current();
            if (current !== last) {
                last = current;
                events.trigger('update', current);
            }
        }

        // Do not run unless breakpoints are available.
        if (!running && breakpoints.length) {
            running = true;
            global.addEventListener('resize', function () {
                if (!working) {
                    working = true;
                    global.requestAnimationFrame(function () {
                        checkUpdate();
                        working = false;
                    });
                }
            });
        }
        checkUpdate();
    }
912860
public function detectChanges()
    {
        $this->signalDispatcher->connect(FlowFileMonitor::class, 'filesHaveChanged', function (string $fileMonitorIdentifier, array $changedFiles) {
            if ($fileMonitorIdentifier === static::FILE_MONITOR_IDENTIFIER) {
                foreach ($changedFiles as $changedFile => $status) {
                    if ($status === ChangeDetectionStrategyInterface::STATUS_DELETED) {
                        $this->unmonitorFile($changedFile);
                        $this->emitFileHasChanged($changedFile);
                    }

                    if ($status === ChangeDetectionStrategyInterface::STATUS_CHANGED) {
                        $this->emitFileHasChanged($changedFile);
                    }
                }
            }
        });

        $fileMonitor = new FlowFileMonitor(static::FILE_MONITOR_IDENTIFIER);
        $files = $this->cache->getByTag('file');

        foreach ($files as $file) {
            $fileMonitor->monitorFile($file);
        }

        $fileMonitor->detectChanges();
        $fileMonitor->shutdownObject();
    }
350885
protected synchronized void notifyChange(File file)
   {
      
      
      System.out.println("Notify change file="+file.getAbsolutePath());
      
   
      this.notify(FileEvent.createChangedEvent(file));
   }