I am using a linux system and need to experiment with some permissions on a set of nested files and directories. I wonder if there is not some way to save the permissions for the files and directories, without saving the files themselves.
In other words, I’d like to save the perms, edit some files, tweak some permissions, and then restore the permissions back onto the directory structure, keeping the changed files in place.
Does that make sense?
hm. so you need to
1) read file permissions
2) store them somehow, associated to each file
3) read your stored permissions and set them back
not a complete solution but some ideas:
probably in combination with
to store this information, this so question has some interesting ideas. basically you create a temporary file structure matching your actual files, with each temp file containing the file permissions
to reset you iterate over your temp files, read permissions and chmod the actual files back.