- Hashtbl.add wdmap wd (dir,Activehandler(handler))
-
-let mask_events wd =
- let (dirname,handler) = try Hashtbl.find wdmap wd with Not_found->("",Nohandler)
- in
- match handler with
- | Activehandler(func)->
- Hashtbl.replace wdmap wd (dirname,Maskedhandler(func))
- | _ ->
- ()
-
-let unmask_events wd =
- let (dirname,handler) = try Hashtbl.find wdmap wd with Not_found->("",Nohandler)
- in
- match handler with
- | Maskedhandler(func)->
- Hashtbl.replace wdmap wd (dirname,Activehandler(func))
- | _ ->
- ()
-
-
- (* XXX
-let del_watch dir =
- fprintf logfd "Removing watch for %s\n" dir;flush logfd;
- let wd = Inotify.rm_watch fd dir in
- Hashtbl.remove wdmap wd
- *)
+ Hashtbl.add wdmap wd (dir,Some(handler))
+ (* Ignore the possibility that the whole directory can disappear and come
+ * back while it is masked *)