ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: zipping a single file
Date Mon, 26 Aug 2002 23:07:33 GMT
Yes, but only with the CVS version of Ant.  I added a 'file' attribute 
to FileSet such that you can now say this:

	<fileset file="/some/path/to/a/file.txt"/>

And it will create the fileset with only that one file.  Internally it 
does the same thing as the basename and includes, but its much more 
pleasant to work with and you don't have to worry about property 
immutability biting you!  :)

	Erik


Andrew van Renen wrote:
> I want to add a single file to an archive.  Looking through the docs, I 
> expected to be able to write:
> 
>     <zip includes="${to}" destfile="${backup_zip}"
> 
> but this returned the error: "basedir attribute must be set, or at least 
> one fileset must be given!".
> 
> So I ended up with:
> 
>     <dirname property="to.path" file="${to}"/>
>     <basename property="to.filename" file="${to}"/>
>     <zip destfile="${backup_zip}">
>         <fileset dir="${to.path}" includes="${to.filename}"/>
>     </zip>
> 
> That seems a little laborious - is there an easier way?
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.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