MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / CreateFileWithContents

Function CreateFileWithContents

tools/base/utils.py:129–134  ·  view source on GitHub ↗
(filename, text="", force_recreate=False)

Source from the content-addressed store, hash-verified

127
128
129def CreateFileWithContents(filename, text="", force_recreate=False):
130 if CreateFile(filename, force_recreate):
131 with open(filename, "wb") as file:
132 file.write(text.encode('utf-8'))
133 return True
134 raise IOError("Can't create file \"{}\"!".format(filename))
135
136
137def RenameDirectory(srcname, dstname):

Callers

nothing calls this directly

Calls 3

CreateFileFunction · 0.85
writeMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected