79544523

Date: 2025-03-30 11:39:27
Score: 0.5
Natty:
Report link

If I understand correctly, you want to change the permissions of each individual directory along a tree path, creating each directory beforehand if it doesn't exist.

I don't think that there is a function doing exactly that, and I don't know any other way than changing each directory of the path. That means in a loop.

Except if you accept to :

  1. rely on the OS commands

  2. Change also the directories files permissions

Then you could issue a "chmod -R" shell command on the top-most directory.

What is dest_root"? Shouldn't it be current_dir ?

If you just need to create a directory tree with the given permissions, os.makedirs as a mode parameter.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: cidonia