'Clean all opened files and directories.'

def connectionLost(self, reason):

    for fileObj in self.openFiles.values():
        fileObj.close()
    self.openFiles = {}
    for (dirObj, dirIter) in self.openDirs.values():
        dirObj.close()
    self.openDirs = {}
