def is_platform_file(path):
 if ((not os.path.exists(path)) or os.path.islink(path)):
  return False
 with open(path, 'rb') as fileobj:
  bytes = fileobj.read(MAGIC_LEN)
  if (bytes == FAT_MAGIC_BYTES):
   fileobj.seek(0)
   header = mach_o.fat_header.from_fileobj(fileobj, _endian_='>')
   if (header.nfat_arch < 1):
    return False
   arch = mach_o.fat_arch.from_fileobj(fileobj, _endian_='>')
   fileobj.seek(arch.offset)
   bytes = fileobj.read(MAGIC_LEN)
 for magic in MAGIC:
  if (bytes == magic):
   return True
 return False

def is_platform_file ( path ) : if ( ( not os . path . exists ( path ) ) or os . path . islink ( path ) ) : return False with open ( path , 'rb' ) as fileobj : bytes = fileobj . read ( MAGIC_LEN ) if ( bytes == FAT_MAGIC_BYTES ) : fileobj . seek ( 0 ) header = mach_o . fat_header . from_fileobj ( fileobj , _endian_ = '>' ) if ( header . nfat_arch < 1 ) : return False arch = mach_o . fat_arch . from_fileobj ( fileobj , _endian_ = '>' ) fileobj . seek ( arch . offset ) bytes = fileobj . read ( MAGIC_LEN ) for magic in MAGIC : if ( bytes == magic ) : return True return False
return true if the file is mach-o .