Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 21658 invoked from network); 15 Apr 2003 14:45:43 -0000 Received: from auds953.usa.alcatel.com (143.209.238.6) by daedalus.apache.org with SMTP; 15 Apr 2003 14:45:43 -0000 Received: from alcatel.com (localhost [127.0.0.1]) by auds953.usa.alcatel.com (8.12.8p1/8.12.8) with ESMTP id h3FEjjRl006285 for ; Tue, 15 Apr 2003 09:45:45 -0500 (CDT) Message-ID: <3E9C1B18.80756A8C@alcatel.com> Date: Tue, 15 Apr 2003 09:45:44 -0500 From: Sebastien Blanc Organization: Alcatel USA X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Ant Users List Subject: Re: Renaming a directory when the source directory is not known References: <99B81BEBF8E86A4A960972A64E7F7D7A06B29C@satlrccdlmb01.delta.rl.delta.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ok. so you can do a move as u did, the only remaining pb beeing to dynamically get the name of the directory for your archive into a property. how about the dirname task ? seb. "Halstead, Chris" wrote: > Seb - Thanks again for all your help. Your example works just fine, but the problem is that the source directory won't always be named 'foo'. I need a way to do what the code snippet below does without having to know that the directory is named 'foo' beforehand. > > What I'm trying to accomplish is this: when I extract a ZIP archive to the output dir I end up with something like /output/archive-1.2.3. I want to change it to be /output/archive without having to know that the original was named 'archive-1.2.3'. > > Thanks, > > -chris > > > > > Chris, > > I just did the following test: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > and somedir/foo directory is moved to somedir/bar directory > > just fine (having recursive content in foo at the beginning). > > am I missing smthg ? if ur example it looks to me you move > > somedir directory to somedir/bar directory which would be > > somewhat a bit difficult. [also are u sure the ${target} > > property is defined properly when your PREP target is called > > ? if the pattern is erroneous then the mapper will not do anything.] > > > > FYI cd then be embedded into the fileset to map the > > new files to new directory or names but looking at your need > > the above is enough. > > > > hope this will help, maybe add an echo "mv-ing ${your_from} > > to ${your_to}" before the call to to see what is happening. > > > > seb. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org