let find_in_path x name =
if not (Filename.is_implicit name)
then if Sys.file_exists name then name else raise Not_found
else
(let res =
fold_load_path x
(fun dir ->
function
| None ->
let fullname = Filename.concat dir name
in
if Sys.file_exists fullname
then Some fullname
else None
| x -> x)
None
in match res with | None -> raise Not_found | Some x -> x)