moving files across devices

M

Matt Price

Hi folks,

I'm trying to move files across devices on my linux box. Here's what
I had:
os.rename(sFileName, dir + newName)
which gives:

Traceback (most recent call last):
File "/usr/local/scripts/sort_mp3s.py", line 68, in ?
localSort(i, defaultSaveDir)
File "/usr/local/scripts/sort_mp3s.py", line 34, in localSort
os.rename(sFileName, dir + newName)
OSError: [Errno 18] Invalid cross-device link

ok, so that doesn't work. is there another method?

thx,
matt
 
A

Alex Martelli

Matt Price said:
Hi folks,

I'm trying to move files across devices on my linux box. Here's what
I had:
os.rename(sFileName, dir + newName) ...
ok, so that doesn't work. is there another method?

shutil.move


Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,416
Messages
2,571,562
Members
48,797
Latest member
shadowoftheunknown

Latest Threads

Top