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

Method remove_mapping

qiling/os/mapper.py:220–236  ·  view source on GitHub ↗

Remove a mapping from the fs mapper. Args: vpath: bound virtual path to remove Raises: `KeyError`: in case the specified vpath has no mapping

(self, vpath: QlPath)

Source from the content-addressed store, hash-verified

218 self._mapping[absvpath] = binding
219
220 def remove_mapping(self, vpath: QlPath) -> None:
221 """Remove a mapping from the fs mapper.
222
223 Args:
224 vpath: bound virtual path to remove
225
226 Raises:
227 `KeyError`: in case the specified vpath has no mapping
228 """
229
230 vpath = self.__fspath(vpath)
231 absvpath = self.path.virtual_abspath(vpath)
232
233 if not self.has_mapping(absvpath):
234 raise KeyError(absvpath)
235
236 del self._mapping[absvpath]
237
238 def rename_mapping(self, old_vpath: str, new_vpath: str) -> None:
239 old_absvpath = self.path.virtual_abspath(old_vpath)

Callers 2

remove_fs_mapperMethod · 0.80
__do_unlinkFunction · 0.80

Calls 3

__fspathMethod · 0.95
has_mappingMethod · 0.95
virtual_abspathMethod · 0.80

Tested by

no test coverage detected