271 issue5584 for detail). |
271 issue5584 for detail). |
272 """ |
272 """ |
273 self._auditpath(dst, b'w') |
273 self._auditpath(dst, b'w') |
274 srcpath = self.join(src) |
274 srcpath = self.join(src) |
275 dstpath = self.join(dst) |
275 dstpath = self.join(dst) |
276 oldstat = checkambig and util.filestat.frompath(dstpath) |
276 oldstat = util.filestat.frompath(dstpath) if checkambig else None |
|
277 |
|
278 util.rename(srcpath, dstpath) |
|
279 |
277 if oldstat and oldstat.stat: |
280 if oldstat and oldstat.stat: |
278 ret = util.rename(srcpath, dstpath) |
|
279 _avoidambig(dstpath, oldstat) |
281 _avoidambig(dstpath, oldstat) |
280 return ret |
|
281 return util.rename(srcpath, dstpath) |
|
282 |
282 |
283 def readlink(self, path: bytes) -> bytes: |
283 def readlink(self, path: bytes) -> bytes: |
284 return util.readlink(self.join(path)) |
284 return util.readlink(self.join(path)) |
285 |
285 |
286 def removedirs(self, path: Optional[bytes] = None): |
286 def removedirs(self, path: Optional[bytes] = None): |