Shortcuts

mmengine.fileio.get

mmengine.fileio.get(filepath, backend_args=None)[源代码]

Read bytes from a given filepath with ‘rb’ mode.

参数:
  • filepath (str or Path) – Path to read data.

  • backend_args (dict, optional) – Arguments to instantiate the corresponding backend. Defaults to None.

返回:

Expected bytes object.

返回类型:

bytes

示例

>>> filepath = '/path/of/file'
>>> get(filepath)
b'hello world'