Change ownership to the given user and group. user and group may be specified by a number or by a name. if rec is True change ownership recursively.
(self, user, group, rec=0)
| 299 | if sys.platform != class="st">"win32": |
| 300 | |
| 301 | def chown(self, user, group, rec=0): |
| 302 | class="st">"""Change ownership to the given user and group. |
| 303 | user and group may be specified by a number or |
| 304 | by a name. if rec is True change ownership |
| 305 | recursively. |
| 306 | class="st">""" |
| 307 | uid = getuserid(user) |
| 308 | gid = getgroupid(group) |
| 309 | if rec: |
| 310 | for x in self.visit(rec=lambda x: x.check(link=0)): |
| 311 | if x.check(link=0): |
| 312 | error.checked_call(os.chown, str(x), uid, gid) |
| 313 | error.checked_call(os.chown, str(self), uid, gid) |
| 314 | |
| 315 | def readlink(self) -> str: |
| 316 | class="st">""class="st">"Return value of a symbolic link."class="st">"" |