How can I find and delete empty files?
As a result of an Ant process, I generate several files (the contents of a batch svn diff). In this case, some diff files are empty, so I would like to delete them aut开发者_JAVA技巧omatically so I can concentrate only on the differences.
Is there an Ant task that would allow me to delete all files with 0 bytes easily?
Try the delete task using a fileset and the size attribute.
<delete ...>
<fileset ...>
<size value="0" when="equal"/>
</fileset>
</delete>
精彩评论