'Restores its way through the directory using an Iterator.'

def Iterate(self, request, client_state):

    try:
        fd = vfs.VFSOpen(request.pathspec, progress_callback=self.Progress)
    except (IOError, OSError) as e:
        self.SetStatus(rdf_flows.GrrStatus.ReturnedStatus.IOERROR, e)
        return
    files = list(fd.ListFiles())
    files.sort(key=(lambda x: x.pathspec.path))
    index = client_state.get('index', 0)
    length = request.iterator.number
    for response in files[index:(index + length)]:
        self.SendReply(response)
    client_state['index'] = (index + length)
