'Iterate in this state until no more results are available.'

@flow.StateHandler()
def IterateFind(self, responses):

    if (not responses.success):
        raise IOError(responses.status)
    for response in responses:
        vfs_urn = response.hit.pathspec.AFF4Path(self.client_id)
        if stat.S_ISDIR(response.hit.st_mode):
            fd = aff4.FACTORY.Create(vfs_urn, standard.VFSDirectory, token=self.token)
        else:
            fd = aff4.FACTORY.Create(vfs_urn, aff4_grr.VFSFile, token=self.token)
        stat_response = fd.Schema.STAT(response.hit)
        fd.Set(stat_response)
        fd.Set(fd.Schema.PATHSPEC(response.hit.pathspec))
        fd.Close(sync=False)
        self.SendReply(stat_response)
    self.state.received_count += len(responses)
    if ((self.state.received_count < self.args.max_results) and (responses.iterator.state != responses.iterator.State.FINISHED)):
        self.args.findspec.iterator = responses.iterator
        self.args.findspec.iterator.number = min(self.args.findspec.iterator.number, (self.args.max_results - self.state.received_count))
        self.CallClient(server_stubs.Find, self.args.findspec, next_state='IterateFind')
        self.Log('%d    files    processed.', self.state.received_count)
