let mkstat unix_stat x =
let st =
try unix_stat x
with Unix.Unix_error _ as e -> raise (Sys_error (My_std.sbprintf "%a" report_error e))
in
{ stat_key = sprintf "(%d,%d)" st.Unix.st_dev st.Unix.st_ino;
stat_file_kind =
match st.Unix.st_kind with
| Unix.S_LNK -> FK_link
| Unix.S_DIR -> FK_dir
| Unix.S_CHR | Unix.S_BLK | Unix.S_FIFO | Unix.S_SOCK -> FK_other
| Unix.S_REG -> FK_file }