readlink

readlink(path) -> AbstractString

Returns the value of a symbolic link path.

Examples

julia> readlink("/path/to/symlink")
"/path/to/target"

This example demonstrates how to use the readlink function to retrieve the target of a symbolic link located at /path/to/symlink. It returns the absolute path of the target.

Common mistakes:

julia> readlink("/nonexistent/symlink")
ERROR: SystemError: readlink: No such file or directory (ENOENT)

In this example, the readlink function throws an error because the specified symbolic link does not exist. Make sure the path you provide corresponds to an existing symbolic link.

julia> readlink("/path/to/file")
ERROR: SystemError: readlink: Not a symbolic link (EINVAL)

This error occurs when the specified path is not a symbolic link. Ensure that the path you pass to readlink points to a valid symbolic link, as it is designed to work specifically with symbolic links.

See Also

abspath, basename, chmod, countlines, cp, ctime, dirname, download, evalfile, expanduser, fdio, filemode, filesize, functionloc, gperm, homedir, include_string, isabspath, isblockdev, ischardev, isdir, isdirpath, isexecutable, isfifo, isfile, islink, ismount, ispath, isreadable, issetgid, issetuid, issticky, iswritable, joinpath, less, lstat, mkdir, mkpath, mktemp, mktempdir, mtime, mv, normpath, operm, poll_fd, poll_file, readall, readcsv, readdir, readdlm, readlines, readlink, realpath, relpath, rm, splitdir, splitdrive, splitext, stat, symlink, tempdir, tempname, touch, truncate, uperm, watch_file, writecsv,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: