ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44549] New: Delete with an empty includesfile deletes all files
Date Thu, 06 Mar 2008 19:04:43 GMT

           Summary: Delete with an empty includesfile deletes all files
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P3
         Component: Core tasks

If you use a delete task with a fileset using an empty includesfile, Ant
deletes all files in the given directory.

<target name="deleteTest">
      <fileset dir="c:\temp" includesfile="c:\temp\empty.txt"/>

In the above target, empty.txt has no patterns in it and all files in c:\temp
are  deleted.

The Ant docs state that 'all files are included when [includes is] omitted'. In
this case, since an includesfile is used, the expectation is that only patterns
in the includesfile will be applied. Since there are no patterns in the file,
nothing should be applied. The default behavior for includes should be treated
as a separate case. 

For the sake of the user's data, greedy delete is a bad idea.
I've marked this critical because of the unexpected data loss.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message