Rename or move a file / directory. Args: src: string, pathname for a file dst: string, pathname to which the file needs to be moved overwrite: boolean, if false it's an error for `dst` to be occupied by an existing file. Raises: errors.OpError: If the operation fails.
(src, dst, overwrite=False)
| 504 | |
| 505 | @tf_export("io.gfile.rename") |
| 506 | def rename_v2(src, dst, overwrite=False): |
| 507 | """Rename or move a file / directory. |
| 508 | |
| 509 | Args: |
| 510 | src: string, pathname for a file |
| 511 | dst: string, pathname to which the file needs to be moved |
| 512 | overwrite: boolean, if false it's an error for `dst` to be occupied by an |
| 513 | existing file. |
| 514 | |
| 515 | Raises: |
| 516 | errors.OpError: If the operation fails. |
| 517 | """ |
| 518 | pywrap_tensorflow.RenameFile( |
| 519 | compat.as_bytes(src), compat.as_bytes(dst), overwrite) |
| 520 | |
| 521 | |
| 522 | def atomic_write_string_to_file(filename, contents, overwrite=True): |