[Tutor] windows file permissions
deliberatus at verizon.net
Fri Mar 16 06:15:58 CET 2007
I answered my own question digging around and testing stuff. Here is my
solution for a windows environment:
if not os.access(pagename,os.W_OK):
print 'Sorry, that file is read only,<p>'
print 'Please consult your system administrator<br>'
print 'if this file must be modified.<P>'
And it works, testing it by manually setting a page in the wiki of my
laptop to read only. it now politely refuses to attempt to edit a read
only file. This lets me set important pages such as the user license to
read only. YES, one may go in and manually turn them over to writable
state if one knows how- ie, one is a geek like us. ordinary consumer
office road warriors do not.
Now to figure out how to best sell the thing to the target market...
Kirk Bailey wrote:
> how do I check file permission in windows environments in python? I am
> modifying an existing editor program in my wiki to refuse to TRY to edit
> a file if it is set to read only. Until very recently, all my system
> stuff was in a un*x environment (well, FreeBSD) which is just not the same.
| BOX |
More information about the Tutor