static FileSystemWatcher CreateWatcher (string file, FileSystemEventHandler hnd, RenamedEventHandler reh)
{
FileSystemWatcher watcher = new FileSystemWatcher ();
watcher.Path = Path.GetFullPath (Path.GetDirectoryName (file));
watcher.Filter = Path.GetFileName (file);
// This will enable the Modify flag for Linux/inotify
watcher.NotifyFilter |= NotifyFilters.Size;
watcher.Changed += hnd;
watcher.Created += hnd;
watcher.Deleted += hnd;
watcher.Renamed += reh;
watcher.EnableRaisingEvents = true;
return watcher;
}