(src, dst, hardlink_function=hardlink, mkdir_function=os.mkdir)
| 261 | # Throws OSError |
| 262 | @errorfix_win |
| 263 | def hardlink_tree(src, dst, hardlink_function=hardlink, mkdir_function=os.mkdir): |
| 264 | if not os.path.exists(src): |
| 265 | raise CustomFsError(errno.ENOENT, filename=src) |
| 266 | if os.path.isfile(src): |
| 267 | hardlink_function(src, dst) |
| 268 | return |
| 269 | for dirpath, _, filenames in walk_relative(src): |
| 270 | src_dirpath = os.path.join(src, dirpath) if dirpath != '.' else src |
| 271 | dst_dirpath = os.path.join(dst, dirpath) if dirpath != '.' else dst |
| 272 | mkdir_function(dst_dirpath) |
| 273 | for filename in filenames: |
| 274 | hardlink_function(os.path.join(src_dirpath, filename), os.path.join(dst_dirpath, filename)) |
| 275 | |
| 276 | |
| 277 | # File copy |
nothing calls this directly
no test coverage detected