Copy timestamps from `src` to `dst`. Similar to and derived from Python shutil module. See fileutils.py.ABOUT for details.
(src, dst)
| 453 | |
| 454 | |
| 455 | def copytime(src, dst): |
| 456 | """ |
| 457 | Copy timestamps from `src` to `dst`. |
| 458 | |
| 459 | Similar to and derived from Python shutil module. See fileutils.py.ABOUT |
| 460 | for details. |
| 461 | """ |
| 462 | errors = [] |
| 463 | st = os.stat(src) |
| 464 | if hasattr(os, "utime"): |
| 465 | try: |
| 466 | os.utime(dst, (st.st_atime, st.st_mtime)) |
| 467 | except OSError as why: |
| 468 | if WindowsError is not None and isinstance(why, WindowsError): |
| 469 | # File access times cannot be copied on Windows |
| 470 | pass |
| 471 | else: |
| 472 | errors.append((src, dst, str(why))) |
| 473 | return errors |
| 474 | |
| 475 | |
| 476 | # |