Challenge 1
Copy the source file to the exact destination path while attempting to preserve available metadata.
from pathlib import Path
import shutil
from tempfile import TemporaryDirectory
with TemporaryDirectory() as folder:
root = Path(folder)
source = root / "source.txt"
destination = root / "copy.txt"
source.write_text("copy me", encoding="utf-8")
assert destination.read_text(encoding="utf-8") == "copy me"
print(destination.name)
Press Ctrl⌘Enter to check your answer