Skip to content

Instantly share code, notes, and snippets.

DSc-de /
Last active June 11, 2022 11:38
Python script to make all files in the current directory writable
import os
import os.path
import stat
def MakeFilesWritable(workingDir='.', silent=False):
numOfFiles = 0
for dirpath, dirnames, filenames in os.walk(workingDir):
for filename in filenames:
path = os.path.join(dirpath, filename)
os.chmod(path, stat.S_IWRITE)