readlink -- Read Symbolic Link

SYNOPSIS

 #include <unistd.h>

 int readlink(const char *fn, char *buf, size_t size)
 

DESCRIPTION

readlink reads the contents of a symbolic link. fn is the pathname. buf is the buffer into which the information is read. size is the size of the buffer in bytes.

When you call readlink in a non-posix-compiled application, the link name is interpreted according to the normal rules for interpretation of file names. The name should include a style prefix if the default style is not "hfs". Also, when readlink is called in a non-posix-compiled application, the value stored in buf has the style prefix "hfs:" prepended.

RETURN VALUE

readlink returns the number of bytes stored into the buffer, or the number of bytes in the symbolic link if the buffer size is 0. readlink returns - 1 if it is not successful.

EXAMPLE

The example for symlink also illustrates the use of readlink.

RELATED FUNCTIONS

symlink

SEE ALSO


Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.