shutil move raising Invalid cross-device link error
Asked Answered
A

0

7

I am using Python 3.5.

I am using shutil.move(src, dest) to move a file between 2 different file systems.

As I understand cross-device link error is raised by OS because it can't create hard links across 2 different file systems, which is fine.

But as per documentation, shutil.move can move files by copying it to destination and then deleting it at the source.

My exception further says that the exception is because of os.rename that is internally called on line 538 of in shutil.move source code.

Anyone knows how to make shutil.move work?

I read tons of post suggesting shutil.move would definitely work to copy files between 2 file systems, including the documentation .

Advisement answered 17/4, 2017 at 21:58 Comment(5)
Show your code!Avionics
What OS? What are the file systems? (e.g. FAT, NTFS, HFS?)Inheritrix
its Suse Linux ... @Avionics the code is not complicated, for testing I wrote a simple script with a simple shutil.move statement and 2 inputs through command line...same error for that!Advisement
I'm sure the developers of shutil tested "not complicated" cases. If you show your code I can try it on my laptop and check the error codes etc. Are you using full path.name? I have windows 10.Avionics
Possible duplicate of OSError: [Errno 18] Invalid cross-device linkTibetan

© 2022 - 2024 — McMap. All rights reserved.