How to remove read-only from a file

Tim Golden mail at timgolden.me.uk
Fri Jun 6 12:05:03 EDT 2008


Robert Dailey wrote:
> Hi,
> 
> Using Python 3.0, how can I remove a read-only property from a file in
> Windows XP? Thanks.

import os
import stat

os.chmod ("c:/temp/temp.txt", stat.S_IWRITE)

(Haven't actually checked that on Python 3.0 but I don't believe
it's changed...)

TJG



More information about the Python-list mailing list