equal
deleted
inserted
replaced
480 |
480 |
481 return check |
481 return check |
482 |
482 |
483 def copyfile(src, dest): |
483 def copyfile(src, dest): |
484 "copy a file, preserving mode and atime/mtime" |
484 "copy a file, preserving mode and atime/mtime" |
|
485 if os.path.lexists(dest): |
|
486 unlink(dest) |
485 if os.path.islink(src): |
487 if os.path.islink(src): |
486 try: |
|
487 os.unlink(dest) |
|
488 except OSError: |
|
489 pass |
|
490 os.symlink(os.readlink(src), dest) |
488 os.symlink(os.readlink(src), dest) |
491 else: |
489 else: |
492 try: |
490 try: |
493 shutil.copyfile(src, dest) |
491 shutil.copyfile(src, dest) |
494 shutil.copymode(src, dest) |
492 shutil.copymode(src, dest) |