casting FileTypes to u32 in mode_from_kind_and_perm