- let evs = Inotify.read fd in
- List.iter (fun x->
- match x with
- | (wd,evlist,_,Some(str)) ->
- let purestr = asciiz(str) in
- let (dirname,handler) =
- try Hashtbl.find wdmap wd with Not_found->printf "Unknown watch descriptor\n";raise Not_found
- in
- (
- match handler with
- | None->handle_dir_event dirname evlist purestr
- | Some(handler)->handler dirname evlist purestr
- )
- | _ -> ())
- evs
+ let evs = Inotify.read fd in
+ List.iter (fun x->
+ match x with
+ | (wd,evlist,_,Some(str)) ->
+ begin
+ let purestr = asciiz(str) in
+ let (dirname,handler) =
+ try Hashtbl.find wdmap wd with Not_found->("",None)
+ in
+ match handler with
+ | None->
+ logprint "Unhandled watch descriptor\n"
+ | Some(handler)->
+ let fqp = String.concat "/" [dirname;purestr] in
+ begin
+ handler wd dirname evlist
+ purestr
+ end
+ end
+ | _ -> ())
+ evs