let is_directory x = try (My_unix.stat x).My_unix.stat_file_kind = My_unix.FK_dir with Sys_error _ -> false