- Hashtbl.add masks dir (wd,handler);
- Hashtbl.add wdmap wd (dir,Some(handler),oneshot)
-
-let mask_watch dir =
- try
- let wd,_ = Hashtbl.find masks dir in
- Inotify.rm_watch fd wd;
- Hashtbl.remove wdmap wd
- with _ ->
- ()
-
-let unmask_watch dir events =
- let _,handler = Hashtbl.find masks dir in
- try
- Hashtbl.remove masks dir;
- add_watch dir events handler
- with Not_found -> ()
+ Hashtbl.add wdmap wd (dir,Some(handler))
+ (* Ignore the possibility that the whole directory can disappear and come
+ * back while it is masked *)