MCPcopy Create free account
hub / github.com/qilingframework/qiling / create_empty_file

Method create_empty_file

qiling/os/mapper.py:161–171  ·  view source on GitHub ↗
(self, vpath: str)

Source from the content-addressed store, hash-verified

159 return os.path.isfile(hpath)
160
161 def create_empty_file(self, vpath: str) -> bool:
162 if not self.file_exists(vpath):
163 try:
164 f = self.open(vpath, "w+")
165 except OSError:
166 # for some reason, we could not create an empty file.
167 return False
168 else:
169 f.close()
170
171 return True
172
173 def __fspath(self, path: QlPath) -> str:
174 """Similar to os.fspath, this method takes a path-like object and returns

Callers 1

_CreateFileFunction · 0.80

Calls 3

file_existsMethod · 0.95
openMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected