from typing import Union
from pathlib import Path


def path_to_posix(path: Union[str, Path]) -> str:
    """Convert a Path to posix string."""
    if isinstance(path, Path):
        return path.absolute().as_posix()
    else:
        return path