Shidai Liu wrote:




I found out in the following situation, it fails to work.
Say, 'somefile.csv' is opened by EXCEL,


os.access('somefile.csv', os.W_OK)


True


file('somefile.csv', 'w')


IOError: [Errno 13] Permission denied: 'somefile.csv'

By the way, using os.stat & stat as suggested by Alan doesn't work either.
Any idea how solve it?



I havent got access to a windows box unfortunately at the moment. And I have no idea about permissions on windows boxes anyway :)
However, did you already have the .csv file open in Excel or some other app ? Or is is password protected maybe ?


Sorry not much help.

Nick .
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to