-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow a file to be moved cross-device.
With `os.rename` you get a `OSError: [Errno 18] Invalid cross-device link` if you attempt to move a file across filesystems. `shutil.move` covers the basic case: > If the destination is on the current filesystem, then os.rename() is used. and additionally handles the cross-device case. If the destination is on a different filesystem, we approximate atomicity by first copying the source to a temporary file on the target filesystem, followed by a rename. Finally the source file is removed.
- Loading branch information
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters