Add a fallback for when a rename does not succeed.
In the case where tempdir is on a different filesystem the std::fs::rename call will fail.
This function will return an error in the following situations, but is not limited to just these cases:
- from does not exist.
- The user lacks permissions to view contents.
- from and to are on separate filesystems.
Add a fallback for when a rename does not succeed.
In the case where tempdir is on a different filesystem the
std::fs::rename
call will fail.https://doc.rust-lang.org/std/fs/fn.rename.html
This commit updates the logic to fallback to a copy and delete.
Closes #965