For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
is_absolute
def is_absolute[PathLike: PathLike, //](path: PathLike) -> Bool
Return True if path is an absolute path name. On Unix, that means it begins with a slash.
Example:
from std.os.path import is_absolute
print(is_absolute("/usr/bin")) # True
print(is_absolute("relative")) # False
Parameters:
- PathLike (
PathLike): The type conforming to the os.PathLike trait.
Args:
- path (
PathLike): The path to check.
Returns:
Bool: Return True if path is an absolute path name.