Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unpacking with 7z messes up permissions for resulting files.

Featured Replies

Currently using 6.11.5. 

 

I have thousands of compressed files, .zip and .7z, and I was trying to unpack them into their own folders but had a hell of a time trying to figure out how since I am not familiar with linux and all of that.

 

What I ended up doing that worked was navigating to the folder with Krusader and opening the terminal "here" and running this command:

 

for file in *.7z; do
7z x -o"${file%.7z}" "$file"
done

 

It unpacks the files into their own separate folders which is perfect, but then I can't access the folders via my windows share. It tells me that I don't have the permission to touch the file. Now I fixed this by running the new permissions tool for that specific share, but my question is, is there something different I can do that would do the same thing but without messing up my permissions?

 

I figured out how to do the same with the zip files by running this command:

for file in *.zip; do
unzip -d"${file%.zip}" "$file"
done

 

 however the resulting files do not have any permission issues, they just work.

 

This isn't a major issue but just a QoL sort of thing that would be helpful because I still have a few more thousand files to go with this project. 

 

Solved by BRiT

  • Solution

The 7z file format does NOT store file permissions. You will always need to use a post process script to set permissions to what you want them to be.

 

You may be able to adjust the behavior somewhat by setting "umask".

 

From Wiki:

Quote

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.

A workaround on UNIX-like systems for this is to convert data to a tar bitstream before compressing with 7z. But it is worth noting that GNU tar (common in many UNIX environments) can also compress with the LZMA2 algorithm ("xz") natively, without the use of 7z, using the "-J" switch. The resulting file extension is ".tar.xz" or ".txz" and not ".tar.7z". This method of compression has been adopted with many distributions for packaging, such as Arch, Debian (deb), Fedora (rpm) and Slackware. (The older "lzma" format is less efficient.)[8] On the other hand, it is important to note, that tar does not save the filesystem encoding, which means that tar compressed filenames can become unreadable if decompressed on a different computer..

 

 

 

Edited by BRiT

  • Author
21 minutes ago, BRiT said:

The 7z file format does NOT store file permissions. You will always need to use a post process script to set permissions to what you want them to be.

 

You may be able to adjust the behavior somewhat by setting "umask".

 

From Wiki:

 

 

 

This is good to know! Thank you very much. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.