Add mvfile() to sysutils

This adds mvfile(), which works basically like cpfile().
This commit is contained in:
Will Woods 2011-05-26 18:14:10 -04:00
parent c4337815db
commit 7be79ceba2

View File

@ -92,6 +92,12 @@ def cpfile(src, dst):
return dst
def mvfile(src, dst):
if os.path.isdir(dst):
dst = joinpaths(dst, os.path.basename(src))
os.rename(src, dst)
return dst
def remove(target):
if os.path.isdir(target):
shutil.rmtree(target)