Skip to main content

Mojo function

islink

islink[PathLike: PathLike, //](path: PathLike) -> Bool

Return True if path refers to an existing directory entry that is a symbolic link.

Example:

from std.os.path import islink

islink("/etc/hosts")  # returns False (regular file, not a symlink)

Parameters:

  • PathLike (PathLike): The type conforming to the os.PathLike trait.

Args:

  • path (PathLike): The path to the directory.

Returns:

Bool: True if the path is a link to a directory and False otherwise.

Was this page helpful?