megfile.stdio module

megfile.stdio.is_stdio(path: Union[str, BasePath, PathLike]) bool[source]

stdio scheme definition: stdio://-

Note

Only tests protocol

Parameters:

path – Path to be tested

Returns:

True of a path is stdio url, else False

megfile.stdio.stdio_open(path: Union[str, BasePath, PathLike], mode: str = 'rb', encoding: Optional[str] = None, errors: Optional[str] = None, **kwargs) IO[source]

Used to read or write stdio

Note

Essentially invoke sys.stdin.buffer | sys.stdout.buffer to read or write

Parameters:
  • path – Given path

  • mode – Only supports ‘rb’ and ‘wb’ now

Returns:

STDReader, STDWriter