Jun-24-2024, 10:33 PM
(This post was last modified: Jun-26-2024, 09:42 AM by Larz60+.
Edit Reason: fixed code tags
)
Good night people,
I have a problem, I used the following code to copy and paste files from one folder to another
It started out of nowhere, it always worked, but now this error has started.
I haven't changed anything on my computer
Could you help me find why? Thanks
I have a problem, I used the following code to copy and paste files from one folder to another
import os
import time
import shutil
origem = r"C:\Program Files\Corel\CorelDRAW Graphics Suite 2022\Programs64\Pasta2"
destino = r"C:\Program Files\Corel\CorelDRAW Graphics Suite 2022\Programs64\Pasta1"
def copy_files(origem, destino):
os.makedirs(destino, exist_ok=True)
for item in os.listdir(origem):
origem_arquivo = os.path.join(origem, item)
destino_arquivo = os.path.join(destino, item)
if os.path.isfile(origem_arquivo):
shutil.copy2(origem_arquivo, destino_arquivo)
copy_files(origem, destino)but it started giving an error that I don't have permissionIt started out of nowhere, it always worked, but now this error has started.
I haven't changed anything on my computer
Could you help me find why? Thanks
