Delete the Unix directory that is inside the hidden directory using Ant
I'd really appreciate an answer, despairing a little on this question:
I am trying to delete folder "A" which is under a hidden folder called ".b"
path is root / .b / A and root / c / d
root is represented by $ {user.home}
I can remove the "d" using:
<delete dir="${user.home}/c/d" includeemptydirs="true" failonerror="false" />
but cant delete A:
<delete dir="${user.home}" defaultexcludes="no">
<include name="**/A/*"/>
</delete>
<delete dir="${user.home}/.b/A" includeemptydirs="true" failonerror="false" />
Both methods didn't work. Any ideas?
+3
source to share
2 answers
Works for me ...
Example
$ mkdir -p ~/.dummy/A
$ ant
run:
[delete] Deleting directory /home/me/.dummy/A
BUILD SUCCESSFUL
Total time: 0 seconds
$ find ~/.dummy
/home/me/.dummy
Version
$ ant -version
Apache Ant(TM) version 1.9.4 compiled on April 29 2014
build.xml
<project name="HelloWorld" default="run">
<target name="run">
<delete dir="${user.home}/.dummy/A" verbose="true"/>
</target>
</project>
0
source to share
For me in Groovy ex = filedir = c: / user / work
ant.delete(includeemptydirs: 'true') {
fileset(dir: filedir, includes: '**/*', defaultexcludes: "no")
}
In Ant, the task after adding
defaultexclude = no
then it will remove hidden files as well. Above Ant task is to delete all contents of working folder
0
source to share