islink
Islink is a predicate used in computing to determine whether a given filesystem path refers to a symbolic link. A symbolic link, or symlink, is a special file that points to another file or directory. The exact function or command name varies by language or tool (for example islink, isSymbolicLink, or -L).
In common environments, islink-like checks are designed to detect the link itself rather than dereference the
- Python: os.path.islink(path) returns True if path is a symbolic link, even if the link’s target does
- Java: java.nio.file.Files.isSymbolicLink(Path) reports whether the path is a symbolic link.
- PHP: is_link(filename) returns true when the given filename is a symbolic link.
- C: the lstat system call examines the link itself (as opposed to stat, which follows the link
Usage considerations include the distinction between a link and its target, and cross-platform differences. Some systems,
Overall, islink-like facilities provide a portable means to detect symbolic links across languages and tools, enabling