I have a file of files that I want filter as I copy. I want the
filterreader to look and work similar to a fileset. Here is an example
of what I would like to do. I thought I might be able to write a
scriptfilter to test the concept, but I can't find an Ant class that
will test a filename for membership in a fileset. Can anyone point me in
the right direction to accomplish this?

The aFileOfFiles.txt contains

C:\example\bin\start.bat
C:\example\bin\doit.cmd
C:\example\bin\config.txt
C:\example\lib\app.jar
C:\example\log\error.txt
C:\example\log\warning.txt

Example script

<target name="copyfof">
   <copy file="aFileOfFiles.txt"
         tofile="aCopyFileOfFiles.txt"
   >
      <filterchain>
         <filesetfilter dir="c:\example"/>
            <include name="bin\*.*"/>
            <exclude name="bin\*.cmd"/>
         </filesetfilter>
      </filterchain>
   </copy>
</target>

After running the target, the aCopyFileOfFiles.txt would contain

C:\example\bin\start.bat
C:\example\bin\config.txt

Thanks,
Brian

Reply via email to