5.4. System dependent path handling
Start ocaml section to src/flx_filesys.mli[1
/1
]
1: # 3 "./lpsrc/flx_filesys.ipk"
2: val filetime : string -> float
3: val find_file_in_path:
4: string list -> string -> string
5: val find_file:
6: bool -> string list -> string -> string
7:
Start ocaml section to src/flx_filesys.ml[1
/1
]
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
Start python section to spkgs/misc.py[1
/1
]
1: #line 41 "./lpsrc/flx_filesys.ipk"
2:
3: MISC_LEXS = []
4:
5:
6: MISC_PARSES = [ ]
7:
8:
9: MISC_MODULES = [
10: 'src/flx_filesys',
11: ]
12:
13: MISC_INTERFACES = MISC_MODULES
14:
15: MISC_IMPLEMENTATIONS = MISC_INTERFACES
16:
17: caml_interfaces = MISC_INTERFACES
18: caml_implementations = MISC_IMPLEMENTATIONS
19: