MCPcopy Index your code
hub / github.com/RustPython/RustPython / create_empty_file

Function create_empty_file

Lib/test/support/os_helper.py:601–604  ·  view source on GitHub ↗

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

(filename)

Source from the content-addressed store, hash-verified

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

Callers 7

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

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by 7

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