wire_perms_to_posix
mode = wire_perms_to_posix(wire) | S_IFDIR;
mode = (wire_perms_to_posix(wire) | wire_filetype_to_posix(wire_type));