Maintain file and folder permissions inside archives Maintain file and folder permissions inside archives linux linux

Maintain file and folder permissions inside archives


zip does not store file permissions in the archive.

tar archives will preserve file permissions on Linux and OS X. I have no idea what happens on Windows. If you can test things out on Windows and it works, this is probably your best bet. It probably depends on what tool people use to unpack the archives.

Another option would be to create an installer, although there are few non-commercial options for creating cross-platform installers. Wikipedia has a list.


An installer is your best option here.Lets me explain a bit better why.

Windows has these permissions:

ModifyRead & ExecuteReadWrite

Which are assigned to Groups or Usernames,

Unix based systems have:

ReadWrite Execute

Which can be assigned to owner, group and others.

Has you can see, its difficult to map permissions from one system to another, since the filesystems handle permissions differently.

However some zip utilities like Info-Zip supports Unix based filesystem features, such as user and group IDs, file permissions, and support for symbolic links. It also support NTFS filesystem permissions, and will make an attempt to translate from NTFS permissions to Unix permissions or vice-versa when extracting files. This can result in potentially unintended combinations, e.g. .exe files being created on NTFS volumes with executable permission denied.*

If you are planning on distributing your program, an installer is indeed your best solution.

*From wikipedia: Zip (file format)