ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Bailey" <ch...@codeintensity.com>
Subject RE: How to get just the file/dir name from a FileSet item?
Date Wed, 14 Aug 2002 06:19:11 GMT
Ah, perfect, <basename> was all I needed, not sure why I'd missed that
scanning through the tasks, but thanks!  I knew this could be done easily.

Note, I can't use a DirSet because ForEach doesn't support it, otherwise I
would be.  Probably something that should be fixed...

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Tuesday, August 13, 2002 9:48 PM
To: Ant Users List
Subject: Re: How to get just the file/dir name from a FileSet item?


--- 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>



--
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