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:[EMAIL PROTECTED]] 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 <[EMAIL PROTECTED]> 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 ===== ([EMAIL PROTECTED]) __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
