def _discovering_dist_ids(project):
        # for each file in the project we
        # extract the distutils name
        project_path = '/'.join(project.getPhysicalPath())
        files = cat(**{
            'portal_type': ['PSCFile', 'PSCFileLink'],
            'path': project_path
        })
        ids = []
        for file_ in files:
            portal_type = file_.portal_type
            if portal_type == 'PSCFileLink':
                # the file is somewhere else, let's scan it
                file_ = file_.getObject()
                file_ = DistantFile(file_.getExternalURL())
            else:
                file_ = file_.getObject()
            # trying to get back from old
            # storage
            # ExternalStorage here
            #
            if WAS_EXTERNAL_STORAGE and portal_type != 'PSCFileLink':
                from Products.ExternalStorage.ExternalStorage import\
                     ExternalStorage
                storage = ExternalStorage(
                    prefix=EXTERNAL_STORAGE_PATHS[0],
                    archive=False,
                    rename=False,
                )
                # transferring old data to new AT container
                fs = file_.schema['downloadableFile']
                old = fs.storage
                fs.storage = storage
                portal_url = getToolByName(file_, 'portal_url')

                real_file = os.path.join(
                    *portal_url.getRelativeContentPath(file_))
                for path in EXTERNAL_STORAGE_PATHS:
                    final_file = os.path.join(path, real_file)
                    if os.path.exists(final_file):
                        break
                if not os.path.exists(final_file):
                    logging.info(
                        '******** could not get %s on the file system !!' %
                        real_file)
                    continue
                    #raise ValueError('File not found %s' % final_file)
                fs.storage = old
                dfile = file_.getDownloadableFile()
                filename = dfile.filename
                data = open(final_file).read()
                if data == '':
                    logging.info('empty file ! %s' % final_file)
                #f = File(filename, filename, open(final_file))
            elif portal_type != 'PSCFileLink':
                storage = AttributeStorage()
                fs = file_.schema['downloadableFile']
                old = fs.storage
                fs.storage = storage
                dfile = file_.getDownloadableFile()
                data = dfile.get_data()
                filename = dfile.filename
                fs.storage = old
                #file_.getDownloadableFile().data = data
                #f = File(filename, filename, StringIO(data))
            if portal_type != 'PSCFileLink':
                #file_.setDownloadableFile(f)
                file_.schema = PSCFileSchema
                if filename == '' and data == '':
                    logging.info('file empty for %s' % file_)
                else:
                    if filename is None:
                        filename = file_.getId()
                    file_.setDownloadableFile(
                        File(filename, filename, StringIO(data)))
            id_ = extract_distutils_id(file_)
            if id_ is not None and id_ not in ids:
                ids.append(id_)
        return ids