1: # 10 "./lpsrc/flx_filesys.ipk"
2: exception Found_file of string
3:
4: let find_file_in_path incdirs f =
5: try
6: List.iter
7: (fun d ->
8: let f = Filename.concat d f in
9: if Sys.file_exists f
10: then raise (Found_file f)
11: )
12: incdirs
13: ;
14: ""
15: with Found_file s -> s
16:
17: let find_file lookup incdirs f =
18: if String.length f = 0
19: then failwith "Empty include file name"
20: ;
21: if f.[0] = '/' || not lookup then f
22: else find_file_in_path incdirs f
23:
24: let filetime f =
25: if f = "" then 0.0
26: else
27: try (Unix.stat f).Unix.st_mtime
28: with | _ -> 0.0
29:
30: