Write data to a given ``filepath`` with 'wb' mode. Note: ``write`` will create a directory if the directory of ``filepath`` does not exist. Args: obj (bytes): Data to be written. filepath (str or Path): Path to write data.
(obj: bytes, uri: Union[str, Path])
| 290 | |
| 291 | @staticmethod |
| 292 | def write(obj: bytes, uri: Union[str, Path]) -> None: |
| 293 | """Write data to a given ``filepath`` with 'wb' mode. |
| 294 | |
| 295 | Note: |
| 296 | ``write`` will create a directory if the directory of ``filepath`` |
| 297 | does not exist. |
| 298 | |
| 299 | Args: |
| 300 | obj (bytes): Data to be written. |
| 301 | filepath (str or Path): Path to write data. |
| 302 | """ |
| 303 | storage = File._get_storage(uri) |
| 304 | return storage.write(obj, uri) |
| 305 | |
| 306 | @staticmethod |
| 307 | def write_text(obj: str, uri: str, encoding: str = 'utf-8') -> None: |