ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: How to get just the file/dir name from a FileSet item?
Date Wed, 14 Aug 2002 04:48:22 GMT
--- Chris Bailey <chris@codeintensity.com> wrote:
> I'd like to use the Foreach ant-contrib task to iterate over a set of
> directories, and assign the name of the directory to a property.  By the
> name, I mean, just the individual directory name.  e.g. if the dir is
> "/foo/bar/goo", then I just want "goo".  Is there a way to do this in
> Ant for a FileSet (or some other way)?

Is there some reason you're starting with a FileSet instead of a DirSet?
You can do what you want using <dirname> and <basename> (in combination
with <pathconvert> and <foreach>), but it'd be simpler if you started with
a DirSet instead. (Although it'd be simpler still if <basename> and
<dirname> were enhanced to allow for a <fileset>/<dirset> -- patches
happily accepted :)

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message