0

I wonder if there is a proper way to clear the read-only flag from all files in a Folder recursively.

I know how I can do this with batch as mentioned in this SU-Question here

So one way I thought of was to use Python's subprocess to just call this batch command.

No my question is, is there a way with either os, pathlib or anything similar to achieve this?

I know, I could do this with os.chmod combined with os.walk in a loop, but is there a more common way, maybe any kind of a single method call?

Igl3
  • 4,900
  • 5
  • 35
  • 69
  • chmod in walk seems to be the only viable option. `shutil` doesn't even have this (in python 3.4, at least) – Jean-François Fabre Jun 06 '18 at 12:26
  • That's a fairly narrow use-case. I think it highly unlikely that this is achievable in a single method call. – SiHa Jun 06 '18 at 12:30
  • @SiHa I don't think it is so uncommon as use case. I came across this already several times over time in different projects. – Igl3 Jun 06 '18 at 12:33

0 Answers0