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

Method __fspath

qiling/os/mapper.py:173–187  ·  view source on GitHub ↗

Similar to os.fspath, this method takes a path-like object and returns its string representation.

(self, path: QlPath)

Source from the content-addressed store, hash-verified

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
175 its string representation.
176 """
177
178 if isinstance(path, PathLike):
179 path = path.__fspath__()
180
181 if isinstance(path, str):
182 return path
183
184 elif isinstance(path, bytes):
185 return path.decode('utf-8')
186
187 raise TypeError(path)
188
189 def add_mapping(self, vpath: QlPath, binding: Union[QlPath, QlFsMappedObject, Callable], *, force: bool = False) -> None:
190 """Create a new mapping in the virtual filesystem.

Callers 2

add_mappingMethod · 0.95
remove_mappingMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected