Community
Participate
Working Groups
Step to reproduce: 1. Create project with a text file. 2. Set the file as read-only in the properties (ensure read-only is set properly outside of eclipse, -rw-r--r--) 3. Export as a zip file 4. Unpack the zip file, in eclipse it's no longer marked as read-only, confirming the permissions of the files outside of eclipse on the command line one gets -rw-rw-r-- One gets similar results if you give the file executable permissions as well/ Expected Results: The zip operation should preserve read-only and executable permissions.
This has been reported a long time ago (bug 28147, marked as dup of bug 25387).
Those bugs more or less talk about the general file system import/export case. There are some issues specific to Zip files which are awkward. The zip format itself does not support file permissions, these are an extension done in Info-ZIP, the most popular implementation on UNIX systems. As a consequence, Java's zip file support does not include the ability to set the permissions on files: http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/ZipEntry.html To fix this we would either have to try to add this support (it may not be hard, I assume you can do it using the extra data section?) or use an existing implementation like the one in apache ant.
I did some research and while I'm not entirely sure, my impression is that the permissions information is placed in the zip header and not in the extra data, which means we may not be able to access it through the java zip API.
"As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009"
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.