os.access(file, os.R_OK) on UNIX and WINDOWS

K

kai rosenthal

Hello,

on UNIX I changed the permission of a file "myfile" with chmod 000
myfile. Then I got 0 from os.access(myfile, os.R_OK). This is ok.

Then I checked the same file on WINDOWS (with samba):
I got "True" from os.access(myfile, os.R_OK). I think it is not ok?!

In my python script I check the return value of os.access(myfile,
os.R_OK) and when it is "True" I copy the file with shutil.copy(myfile,
newfile).
But on WINDOWS I get the error: IOError: [Errno 13] Permission denied.

How can I check the right file access with python on WINDOWS before
copying the file?
Is it a samba configuration?

Thank' for your hints, Kai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top