An equivalent of linux 'cp -r src/* dst/'.
(src, dst)
| 1056 | |
| 1057 | |
| 1058 | def cpdir(src, dst): |
| 1059 | """An equivalent of linux 'cp -r src/* dst/'. """ |
| 1060 | names = os.listdir(src) |
| 1061 | if not os.path.exists(dst): |
| 1062 | os.makedirs(dst) |
| 1063 | for name in names: |
| 1064 | path = os.path.join(src, name) |
| 1065 | if os.path.isdir(path): |
| 1066 | dst_subdir = os.path.join(dst, name) |
| 1067 | shutil.copytree(path, dst_subdir) |
| 1068 | else: |
| 1069 | shutil.copy(path, dst) |
| 1070 | |
| 1071 | |
| 1072 | def mvfiles(src, dst, ext): |
no test coverage detected