ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Any chance for fileset arithmetic?
Date Wed, 30 Jul 2003 07:09:09 GMT
On Tue, 29 Jul 2003, Alexey Solofnenko <A.Solofnenko@mdl.com> wrote:

> but a <fileset> or a <filelist> is essentially a collection of data
> files with names

Not in the case of <fileset>.

> (isn't logically <filelist> an ordered <fileset>?).

No.

A <fileset> is a set of names of existing files rooted in the same
base directory.  There are lots of tasks that do

String[] files = ds.getIncludedFiles();
File base = fs.getDir(getProject());
for (i = 0; i < files.length; i++) {
    File f = new File(base, files[i]);

that would fail horribly if f didn't exist.

> There is no reason for the names to be exactly as they are in the
> file system.

See above.

> Some special tasks like <delete> need to access original files.

All tasks need to.  Some task could want to morph the name into
something else after they have accessed the original file.

> Some other tasks like <copy> or <zip> need only data from the files.
> They do not really care about original file names.

Uhm, OK, if you want to put it that way, maybe.

But be careful, <move> will try to File#renameTo the original file, so
it will need the file names as well.  <zip> will need the original
file names of files in <zipgroupfileset>s in order to create
<zipfileset> from them.

There are not too many tasks that could be made to work without access
to the original file names, at least that's my rough guess.

> Right now tasks have to be aware about any extra fileset
> functionality they support (<zipfileset>, <tarfileset>,...). So the
> proposal is to make it generic.

How?

I don't see how this could be done without changing all tasks.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message