ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: How to unzip files and set read-only mode ?
Date Wed, 02 Feb 2005 09:46:26 GMT
On Wed, 02 Feb 2005, Yves Martin <yves.martin@elca.ch> wrote:

> Of course, I would like that mechanism to be platform independant
> (UNIX, Win32, ...) - so the chmod does not suit my needs.

No way, sorry.

The best thing you can do is something like

<target name="os-check">
  <condition property="unix">
    <os family="unix"/>
  </condition>
  <condition property="windows">
    <os family="windows"/>
  </condition>
</target>
<target name="make-read-only-unix" if="unix" depends="os-check">
  <chmod .../>
</target>
<target name="make-read-only-windows" if="windows" depends="os-check">
  <attrib .../>
</target>
<target name="make-read-only"
        depends="make-read-only-unix,make-read-only-windows"/>

> Does unzip preserve stored access rights when unpacking ?  Is it
> possible to set access rights in a zip with 'zip' task ?

It can't since it is implemented in Java and Java (at least 1.2)
doesn't provide any way to change file permissions.

Stefan

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


Mime
View raw message