/ Published in: Python
as you run chown -R user:group dir
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def _chown(path, uid, gid): os.chown(path, uid, gid) for item in os.listdir(path): itempath = os.path.join(path, item) if os.path.isfile(itempath): os.chown(itempath, uid, gid) elif os.path.isdir(itempath): os.chown(itempath, uid, gid) self._chown(itempath, uid, gid)