I am trying to use shutils to copy a folder but it throws errno 13 at me.
The traceback points to open() as the culprit. I wrote a test script:

open(raw_input("Filename: "))

this is the result:

Filename:e:
Traceback (most recent call last):
File "C:\Documents and Settings\talvey\Desktop\testOpen.py", line 1, in <module>
open(raw_input("Filename:"))
IOError: [Errno 13] Permission denied: 'e:'

'everyone' has full control on e:
I am using winXP

Recommended Answers

All 2 Replies

First of all the files you are trying to access are probably restricted to admin or root. Second of all when you use the open(raw_input("File Name: ")) it should include a whether you want read/write access. Corrected code would be

open(raw_input("File Name: "), 'r')

The 'r' is saying you want to read the file, not write to it. You can also use 'w' for write, 'rb' for reading binary, and 'wb'(i think) for writing to binary.

commented: I love your quotes. +2

Ah, your problem is the following.
You have put in your raw_input() to open the file e:. The problem with that is that you are asking it to open a full directory, not just a file. I had this same problem instead with writing files. You need to specify an actual FILE to open, not a folder or anything else.
So if you put in e:\test_file.txt into the raw_input() and there was a text file called text_file then your program would work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.