Can i store unix permissions in a zip file (built with apache ant)?

前端 未结 7 1673
抹茶落季
抹茶落季 2021-01-02 02:03

I\'m building a linux installer for a Java application, and I end up with an install.jar and a setup.sh that I put in a zip file using ant.

The idea is the user unzi

7条回答
  •  北海茫月
    2021-01-02 02:41

    You cannot store Linux/Unix file permissions in a ZIP file.

    Edit (after comments) by using the "external attributes" field inside the ZIP header these attributes can be store inside a ZIP file. GNU's unzip is apparently able to read that additional field and restore file permissions. I'm not sure when this was added to the ZIP format as the early versions - coming from a MS-DOS world - did not have support for this.

    The TAR format - being a "native" Unix/Linux format - has been designed to include file attributes and Ant can create TAR files that will preserve attributes across all Linux/Unix operating systems.

    
      
         
      
    
    

提交回复
热议问题