Folks,
Might find this on searching, but need this rather quickly done:
I have the path like this: /mnt/path1/path2/path3/
I need to chown all the directories such as /mnt, /mnt/path1, /mnt/path1/path2, /mnt/path1/path2/path3, how to get this done in python?
I cannot do ‘chown -R /mnt/’ since it tries to chown all the files/directories that exist beneath path3, but I wish to chown only upto path3 here for example.
Thank you for any suggestions!
You could do something like this: