Discussion:
Ant 1.8 unzip does not preserve permissions!
ilke Muhtaroglu
2010-07-01 10:18:30 UTC
Permalink
When I unzip with ant command

<unzip src="${app.server.zip.name}" dest="${ext.work.dir}" />

I see the resulting directory does not have the permissions preserved in
linux environment.

At http://ant.apache.org/manual/Tasks/zip.html I see there is an option
"preserve0permissions"...I have an already zipped directory with permissions
adjusted and when I unzip it using ubuntu's unzip It preserves the
permissions but unzip element in ant does not have a permission preserving
option and it results a directory with unpreserved permissions...

ilke
ilke Muhtaroglu
2010-07-01 10:13:10 UTC
Permalink
When I unzip with ant command

<unzip src="${app.server.zip.name}" dest="${ext.work.dir}" />

I see the resulting directory does not have the permissions preserved in
linux environment.

At http://ant.apache.org/manual/Tasks/zip.html I see there is an option
"preserve0permissions"...I have an already zipped directory with permissions
adjusted and when I unzip it using ubuntu's unzip It preserves the
permissions but unzip element in ant does not have a permission preserving
option and it results a directory with unpreserved permissions...


ilke
Stefan Bodewig
2010-07-01 12:30:21 UTC
Permalink
Post by ilke Muhtaroglu
When I unzip with ant command
<unzip src="${app.server.zip.name}" dest="${ext.work.dir}" />
I see the resulting directory does not have the permissions preserved in
linux environment.
This is true. The unzip task doesn't do anything with permissions and
the manual page even says so

,----
| File permissions will not be restored on extracted files.
`----
Post by ilke Muhtaroglu
At http://ant.apache.org/manual/Tasks/zip.html I see there is an option
"preserve0permissions"...
It is the zip task, not the unzip task. And it applies to permissions
read from a different archive when you use the zip task to
repackage/merge archives.

Ant is capable of dealing with permissions inside ZIP and TAR archives
but not on the file system. The latter isn't going to change until the
tasks can run on NIO2 and Java7 because the Java File API currently
simply doesn't provide the means we'd need.

Stefan
John W. Lewis
2010-07-01 12:44:29 UTC
Permalink
<chmod> may be helpful.

http://ant.apache.org/manual/Tasks/chmod.html


-----Original Message-----
From: Stefan Bodewig [mailto:***@apache.org]
Sent: Thursday, July 01, 2010 8:30 AM
To: ***@ant.apache.org
Subject: Re: Ant 1.8 unzip does not preserve permissions!
Post by ilke Muhtaroglu
When I unzip with ant command
<unzip src="${app.server.zip.name}" dest="${ext.work.dir}" />
I see the resulting directory does not have the permissions preserved in
linux environment.
This is true. The unzip task doesn't do anything with permissions and
the manual page even says so

,----
| File permissions will not be restored on extracted files.
`----
Post by ilke Muhtaroglu
At http://ant.apache.org/manual/Tasks/zip.html I see there is an option
"preserve0permissions"...
It is the zip task, not the unzip task. And it applies to permissions
read from a different archive when you use the zip task to
repackage/merge archives.

Ant is capable of dealing with permissions inside ZIP and TAR archives
but not on the file system. The latter isn't going to change until the
tasks can run on NIO2 and Java7 because the Java File API currently
simply doesn't provide the means we'd need.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@ant.apache.org
For additional commands, e-mail: user-***@ant.apache.org
Shawn Castrianni
2010-07-01 16:29:14 UTC
Permalink
What I do is use the exec task and use the tar command. In order to make it cross platform, I use bsdtar which I was able to find a version for all of our supported platforms. The bsdtar command has compression support so the generated tar both preserves the file permissions AND is compressed like zip would be.

---
Shawn Castrianni

-----Original Message-----
From: John W. Lewis [mailto:***@sas.com]
Sent: Thursday, July 01, 2010 7:44 AM
To: Ant Users List
Subject: RE: Ant 1.8 unzip does not preserve permissions!


<chmod> may be helpful.

http://ant.apache.org/manual/Tasks/chmod.html


-----Original Message-----
From: Stefan Bodewig [mailto:***@apache.org]
Sent: Thursday, July 01, 2010 8:30 AM
To: ***@ant.apache.org
Subject: Re: Ant 1.8 unzip does not preserve permissions!
Post by ilke Muhtaroglu
When I unzip with ant command
<unzip src="${app.server.zip.name}" dest="${ext.work.dir}" />
I see the resulting directory does not have the permissions preserved in
linux environment.
This is true. The unzip task doesn't do anything with permissions and
the manual page even says so

,----
| File permissions will not be restored on extracted files.
`----
Post by ilke Muhtaroglu
At http://ant.apache.org/manual/Tasks/zip.html I see there is an option
"preserve0permissions"...
It is the zip task, not the unzip task. And it applies to permissions
read from a different archive when you use the zip task to
repackage/merge archives.

Ant is capable of dealing with permissions inside ZIP and TAR archives
but not on the file system. The latter isn't going to change until the
tasks can run on NIO2 and Java7 because the Java File API currently
simply doesn't provide the means we'd need.

Stefan

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



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

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
Loading...