ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Stevens <insomniacpeng...@googlemail.com>
Subject Re: Ant task to unzip files to a dynamic folder
Date Mon, 12 Oct 2009 23:24:32 GMT
Varman wrote:
> Hi,
> 
> Great thanks..that works.
> But its not working in windows. For windows we have to give something like
> 
>       <propertyregex override="yes"
>       property="zipname"  input="@{file}"
>       regexp=".*\\([^\\]*)\.zip" replace="\1"/>
> 
> See the change in regexp. How can i make it generic for both linux and
> windows?

regexp=".*[\\/]([^\\/]*)\.zip"
perhaps?  Won't work on linux if you actually have a backslash in a 
filename, but how likely is that really?
Or you could use the pathconvert task first to force it into one 
particular form so you know which to use.  Or use the condition task 
with os nested elements to conditionally set some property with the 
appropriate regex and use that regexp="${platform.specific.regex}"
The possibilities are endless...


Andy
-- 
http://pseudoq.sourceforge.net/  open source java sudoku application


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message