You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ja...@rzf.fin-nrw.de on 2004/01/12 12:21:11 UTC

RE: How to Unzip multiple file into separate directories

Use ant-contribs <for> for iterating over the zips.


<for param="filename">
    <path>
        <fileset dir="${my.zip.dir}" includes="*.zip"/>
    </path>
    <sequential>
        <unzip src="@{filename}" dest="${my.zip.dir}/unzipped/@{filename}"/>
    </sequential>
</for>


Pay attention for different notation on ${} and @{}...


Jan


> -----Original Message-----
> From: Scott Goldstein [mailto:sdgoldst@mailandnews.com]
> Sent: Wednesday, December 24, 2003 6:55 PM
> To: user@ant.apache.org
> Subject: How to Unzip multiple file into separate directories
> 
> 
> I have a directory containing a number of zip file.  I would 
> like to unzip 
> each into its own directory under one single parent 
> directory.  For instance, 
> I have a directory, folderOne, that contains a number of zip 
> files, a.zip, 
> b.zip, c.zip, etc.  In my build file, I would like a task to 
> unzip these files 
> into subdirectories of folderTwo, such that a.zip expands to 
> folderTwo/a_zip/ 
> and b.zip expands to folderTwo/b_zip/, etc.
> 
> It seems that the unzip task can handle expanding multiple 
> zip files, but only 
> to a single directory.
> 
> Can anyone tell me how I might accomplish this task?
> 
> Thanks.
> 
> Scott
> 
>  
> -----------------------------------------------------
>                      Shanje.NET
>  The webmaster's 1st choice for Windows 2003 Hosting
>                http://www.Shanje.NET/
> -----------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>