示例#1
0
文件: ftp.py 项目: swift1911/twisted
 def removeDirectory(self, path):
     """
     Remove the given directory.
     """
     try:
         node = self.filesystem.fetch(self._makePath(path))
         if not ivfs.IFileSystemContainer.providedBy(node):
             raise ftp.IsNotADirectoryError(
                 "removeDirectory can only remove directories.")
         node.remove()
     except ivfs.VFSError, e:
         return vfsToFtpError(e)
示例#2
0
 def _got_child(child):
     if must_be_directory and not IDirectoryNode.providedBy(child):
         raise ftp.IsNotADirectoryError("rmdir called on a file")
     if must_be_file and IDirectoryNode.providedBy(child):
         raise ftp.IsADirectoryError("rmfile called on a directory")
     return parent.delete(childname)