MCPcopy Index your code
hub / github.com/python/cpython / create_empty_file

Function create_empty_file

Lib/test/support/os_helper.py:602–605  ·  view source on GitHub ↗

Create an empty file. If the file already exists, truncate it.

(filename)

Source from the content-addressed store, hash-verified

600
601
602def create_empty_file(filename):
603 """Create an empty file. If the file already exists, truncate it."""
604 fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
605 os.close(fd)
606
607
608@contextlib.contextmanager

Callers 8

_add_pkg_dirMethod · 0.90
_add_relative_modulesMethod · 0.90
setUpMethod · 0.90
test_moduleMethod · 0.90
test_localized_errorMethod · 0.90
mktempMethod · 0.90
_test_singleMethod · 0.90
setUpMethod · 0.90

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by 8

_add_pkg_dirMethod · 0.72
_add_relative_modulesMethod · 0.72
setUpMethod · 0.72
test_moduleMethod · 0.72
test_localized_errorMethod · 0.72
mktempMethod · 0.72
_test_singleMethod · 0.72
setUpMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…