how to determine if files are on same or different file systems

Kamus of Kadizhar yan at
Sat Dec 6 23:15:42 CET 2003

Thanks to everyone on this list.  I now have a functioning piece of 
python code!!  :-))

Now I'm trying to clean it up.

I have the same (or similar) lines repeated several times:

       thumb = string.replace(movie,'.avi','.jpg')


       thumb = string.replace(movie,'.avi','.jpg')

what varies is the name of the function (shutil.copy2 or os.rename 
depending on if I am renaming or copying) and the names of the source 
and dest directories.  This particular snippet is repeated about a 
half-dozen times.

It would be nice if I could write a function that would determine if the 
source and destination are on the same file system or not, and thus use 
rename or copy appropriately, or if there is already such a built-in 



What am I on?
I'm on my bike,                         o__
6 hours a day, busting my ass.          ,>/'_
What are you on? --Lance Armstrong     (_)\(_)

More information about the Python-list mailing list