ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn McAllister" <gle...@ca.ibm.com>
Subject Re: [PATCH] Copy.java - some additional checks
Date Thu, 05 Oct 2000 14:39:03 GMT


While checking out Nico's patch I discovered that there is potentially a
problem with the way copying a directory works.  The dir todir combo copys
ALL the files in dir to todir.  The drawback?  The CVS directories get
copied as well.  There is currently no option to turn default excludes on
or off.  I had originally intended that the nested FileSets handle the
pattern matching, not the dir attribute.  When you copy a directory, you
expect to copy everything.  If you don't want something, you usually have
to say so.

Now, I realize that the defaultExcludes thing is a serious convenience for
us.  Do I add a defaultexcludes attribute, which I have to admit I don't
like but does make life lots easier, or do we force people who want elided
copying to use filesets?

So this

<copy dir="${src.bin.dir}" todir="${bin.dir}"/>

becomes

<copy todir="${bin.dir}">
  <fileset dir="${src.bin.dir}"/>
</copy>

to make sure you don't get the CVS directories.

Glenn McAllister
Software Developer. IBM Toronto Lab, (416) 448-3805
"An approximate answer to the right question is better than the
right answer to the wrong question." - John W. Tukey


Please respond to ant-dev@jakarta.apache.org

To:   ant-dev@jakarta.apache.org
cc:
Subject:  [PATCH] Copy.java - some additional checks

1. Check if user specified file and toFile and file contains a directory
2. Check if the target already exists as a file if trying to copy a
directory

Both throwing ugly Java-Exceptions otherwise (at least on W2K)

Nico

I've got a NullPointerException in this part of Delete:

    protected void removeDir(File d) {
        String[] list = d.list();
        for (int i = 0; i < list.length; i++) {

where list seemed to be null but I could not reproduce this. Since this is
only called for directories this can not normally happen if you call list()
on a directory according to the api-docs I left it unchanged...


Mime
View raw message