file permissions on windows XP (home)

Peter Hansen peter at engcorp.com
Tue Jun 7 08:03:41 EDT 2005


barney wrote (having trouble with a file):
[snip]
> IOError: [Errno 13] Permission denied: "02 - New Year's Day.mp3"
[snip]
> I'm at a loss to understand what is going on.
> 
> Why is python returing True from os.access?
> Why isn't chmod doing anything?

Check your results using os.stat() after doing that, perhaps?  If it 
shows the right values for the permissions, then clearly the problem has 
nothing to do with Python per se, or your own code.

> Why is cygwin able to sort the problem out?

I suggest (a) trying again, making sure that the file is not in use in 
another application such as the Media Player, and (b) trying with some 
other file that you've just created for the purpose of testing this to 
compare your results.

I just tried the whole sequence you showed without any problems, on a 
file called "test" that I created in my own My Music folder.  (Not using 
cygwin, however, since I don't use it, but in this case there was no 
need for me to use it anyway.)

-Peter



More information about the Python-list mailing list