let sys_file_exists x =
let dirname = Filename.dirname x in
let basename = Filename.basename x in
match sys_readdir dirname with
| Outcome.Bad _ -> false
| Outcome.Good a ->
if basename = Filename.current_dir_name then true else
try Array.iter (fun x -> if x = basename then raise Exit) a; false
with Exit -> true