Hello Cyril,

have you looked at using a combination of the <depth> and <type>
selectors? 

/t

>-----Original Message-----
>From: Cyril Sagan [mailto:[EMAIL PROTECTED] 
>Sent: Tuesday, March 01, 2005 2:28 AM
>To: user@ant.apache.org
>Cc: [EMAIL PROTECTED]
>Subject: <delete dir="X/Y"> woes!
>
>
>I'm loosing my mind trying to get Ant to delete a directory!
>
>I thought this was easy, until I was sent a path property that
>included multiple directory components.
>
>The obvious was working:
>    <delete dir="${base}" verbose="true" includeEmptyDirs="true" />
>
>...until I was given a path in the form "dirX/dirY".
>
>The result was to remove "dirY" and all its contents, but leave an
>empty "dirX".  Yes, I could use <dirname>:
>    <dirname file="${base}" property="top"/>
>    <delete dir="${top}" verbose="true" includeEmptyDirs="true" />
>
>...but this is no good for arbitrary paths, failing with something as
>simple as "dirX/dirY/dirZ".
>
>I solved this with a trivial shell exec to return the "highest level"
>directory component, but this didn't seem to be the "Ant way".  If
>anyone has any better ideas, I'd be very interested in hearing them.
>
>Thanks!!  I'm stumped!
>
>--Cyril
>
>ps.  I'm using Ant 1.6.2.  The base directories are created as a
>result of an <ftp> get operation embedded in my build.xml.  The
>problem would go away if <ftp> allowed the local path to be different
>from the remote.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to