I am attempting to make a program in Python that copies the files on my flash drive (letter D:) to a folder on my hard drive but am getting a *PermissionError: [Errno 13] Permission denied: 'D:'*.

The problematic part of my code is as follows:

```
# Copy files to folder in current directory
def copy():
    source = getsource()

    if source != "failure":

        copyfile(source, createfolder())
        wait("Successfully backup up drive"
             "\nPress 'Enter' to exit the program")

    else:
        wait("No USB drive was detected"
             "\nPress 'Enter' to exit")

# Create a folder in current directory w/ date and time
def createfolder():
    name = strftime("%a, %b %d, %Y, %H.%M.%S", gmtime())
    dir_path = os.path.dirname(os.path.realpath(__file__))
    new_folder = dir_path + "\\" + name
    os.makedirs(new_folder)

return new_folder

```

Everything seems to run fine until the *copyfile()* function runs, where it returns the error.
I tried replacing *getsource()* with the destination of the file instead and it returned the same permission error except for the *new\_folder* directory instead.

I have read several other posts but none of them seem to be relevant to my case. I have full admin permissions to both locations as well.
Any help would be greatly appreciated!