MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / create_disk_image

Function create_disk_image

tests/TestWipePath.py:76–87  ·  view source on GitHub ↗

Make blank file and return filename The filename prefix includes the mkfs program basename to aid debugging.

(n_bytes, fs_type)

Source from the content-addressed store, hash-verified

74
75
76def create_disk_image(n_bytes, fs_type):
77 """Make blank file and return filename
78
79 The filename prefix includes the mkfs program basename to aid debugging.
80 """
81 (fd, filename) = tempfile.mkstemp(
82 suffix='disk-image', prefix=f'bleachbit-wipe-test-{fs_type}-')
83 try:
84 os.ftruncate(fd, n_bytes)
85 finally:
86 os.close(fd)
87 return filename
88
89
90def run_or_die(args):

Callers 1

wipe_helperFunction · 0.85

Calls 2

mkstempMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected