471,055 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,055 software developers and data experts.

moving files across devices

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
-------------------------------------------
Matt Price ma********@utoronto.ca
History Department, University of Toronto
(416) 978-2094
--------------------------------------------

please don't use the following addresses: ze**@derailleur.org
aa******@derailleur.org
Jul 18 '05 #1
1 1552
Matt Price <ma********@utoronto.ca> wrote:
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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by fuzzybr80 | last post: by
2 posts views Thread by David | last post: by
7 posts views Thread by =?Utf-8?B?TW9iaWxlTWFu?= | last post: by
15 posts views Thread by mcjason | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.