megfile.stdio module

megfile.stdio.is_stdio(path: 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: str | BasePath | PathLike, mode: str = 'rb', encoding: str | None = None, errors: str | None = 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