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

Discussion in 'Python' started by kai rosenthal, Sep 13, 2006.

  1. 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
     
    kai rosenthal, Sep 13, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    12
    Views:
    1,653
    Dave Thompson
    Jan 10, 2005
  2. Tim Golden
    Replies:
    0
    Views:
    847
    Tim Golden
    Sep 13, 2006
  3. Replies:
    18
    Views:
    626
    Dave Thompson
    Jan 10, 2005
  4. Replies:
    2
    Views:
    351
    Noah Roberts
    Nov 23, 2006
  5. Robert Wallace

    my own perl "dos->unix"/"unix->dos"

    Robert Wallace, Jan 21, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    281
    Michele Dondi
    Jan 22, 2004
Loading...

Share This Page