【问题标题】:Get "Unable to delete directory" error when trying to delete all the sub-directories with ant尝试使用 ant 删除所有子目录时出现“无法删除目录”错误
【发布时间】:2011-11-23 09:27:25
【问题描述】:

我的目标是彻底清理我的工作空间。

我尝试使用 ant 删除所有文件和子目录,包括 .svn 目录。

    <delete includeemptydirs="true">
        <fileset dir="${basedir}" defaultexcludes="false">
            <include name="**"/>
        </fileset>
    </delete>

它确实删除了所有子目录。但是,不幸的是,我收到以下错误(在 Windows 上):

“无法删除目录 {工作目录}”

如何避免这个错误?

有关信息,fileset 文档指定 ** 匹配零个或多个目录。尝试了几种方法来排除当前目录,但没有找到解决方案。

【问题讨论】:

    标签: ant delete-file subdirectory


    【解决方案1】:

    添加时 不要再收到错误了...

    这可能是因为删除任务试图删除正在执行的脚本!

    【讨论】:

    • 你能说得更具体些吗...你回答了when adding don't get the error anymorewhen adding什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-07
    • 2014-04-22
    • 1970-01-01
    • 2011-02-18
    • 1970-01-01
    相关资源
    最近更新 更多