MCPcopy Index your code
hub / github.com/nodejs/node / write_file

Method write_file

tools/inspector_protocol/jinja2/environment.py:683–693  ·  view source on GitHub ↗
(filename, data, mode)

Source from the content-addressed store, hash-verified

681 py_header += u'\x00\x00\x00\x00'.encode('iso-8859-15')
682
683 def write_file(filename, data, mode):
684 if zip:
685 info = ZipInfo(filename)
686 info.external_attr = 0o755 << 16
687 zip_file.writestr(info, data)
688 else:
689 f = open(os.path.join(target, filename), mode)
690 try:
691 f.write(data)
692 finally:
693 f.close()
694
695 if zip is not None:
696 from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED, ZIP_STORED

Callers

nothing calls this directly

Calls 4

closeMethod · 0.65
openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected