

def get_record_children(self, record):
    ret = {
        
    }
    if (not record.is_directory()):
        return ret.values()
    try:
        indx_alloc_attr = record.attribute(ATTR_TYPE.INDEX_ALLOCATION)
        indx_alloc = INDEX_ALLOCATION(self.get_attribute_data(indx_alloc_attr), 0)
        indx = indx_alloc
        for block in indx.blocks():
            for entry in block.index().entries():
                ref = MREF(entry.header().mft_reference())
                if ((ref == INODE_ROOT) and (entry.filename_information().filename() == '.')):
                    continue
                ret[ref] = self._enumerator.get_record(ref)
    except AttributeNotFoundError:
        indx_root_attr = record.attribute(ATTR_TYPE.INDEX_ROOT)
        indx_root = INDEX_ROOT(self.get_attribute_data(indx_root_attr), 0)
        indx = indx_root
        for entry in indx.index().entries():
            ref = MREF(entry.header().mft_reference())
            if ((ref == INODE_ROOT) and (entry.filename_information().filename() == '.')):
                continue
            ret[ref] = self._enumerator.get_record(ref)
    return ret.values()

dataset/ETHPy150Open williballenthin/python-ntfs/ntfs/filesystem/__init__.py NTFSFilesystem.get_record_children/original