PyDocs

Nav

Generic Operating System Services

replace

os

function · Added in 3.3
  • replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
Rename a file or directory, overwriting the destination.

If either src_dir_fd or dst_dir_fd is not None, it should be a file
descriptor open to a directory, and the respective path string (src or
dst) should be relative; the path will then be relative to that
directory.
src_dir_fd and dst_dir_fd, may not be implemented on your platform.
If they are unavailable, using them will raise a NotImplementedError.
Changed in 3.6
  • 3.6: Accepts a path-like object for src and dst.
0 Examples
No examples for os/replace.
See Also
No see-alsos for os/replace
0 Notes
No notes for replace