python - os.chmod equivalent on Windows -
i need change line in text file based on criteria. running following script:
fh, newmapfullname = mkstemp() newmapfile = open (newmapfullname, 'w') oldmapfile = open(oldmapfullname) pattern = 'processing "chart_size_range=' substr= 'processing "chart_size_range= {0} {1} {2} {3} {4}"'.format("sum_all", minpix, maxpix, oldminsum, oldmaxsum) line in oldmapfile: if pattern in line: newmapfile.write(substr) else: newmapfile.write(line) this script works intended, changes file permissions. can open file if done command prompt administrator. running python 2.7 on windows. this response suggests possible os.chmod, isn't available on windows. there equivalent process work?
Comments
Post a Comment