refactored likely_file_type_mask and likely_read