ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44549] New: Delete with an empty includesfile deletes all files
Date Thu, 06 Mar 2008 19:04:43 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44549

           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
        AssignedTo: notifications@ant.apache.org
        ReportedBy: andy.kriger@gmail.com


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

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

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: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message