fajrian
fajrian

Reputation: 527

Extracting 7z file using 7-zip-jbinding and preserving unix file mode

How to extract a 7z file using 7-zip-jbinding (http://sevenzipjbind.sourceforge.net/) while preserving the Unix file mode (rwx)? I use Oracle Java 7. After extracting 7z file using 7-zip-jbinding, my files are no longer executable.

Upvotes: 1

Views: 776

Answers (1)

thrau
thrau

Reputation: 3100

Unfortunately this is a limitation of 7z.

From Wikipedia:

The 7z format does not store filesystem permissions (such as UNIX owner/group permissions or NTFS ACLs), and hence can be inappropriate for backup/archival purposes.

If you control the archive creation, you can build a tarball before compressing it with 7z. However you need the extra mechanism to extract the tar. All workarounds will involve something of the sort.

Upvotes: 1

Related Questions