ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
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 <> 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 :)



Do You Yahoo!?
HotJobs - Search Thousands of New Jobs

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message