Go to the first, previous, next, last section, table of contents.
#include <unistd.h> int readlink(const char *filename, char *buffer, size_t size);
MSDOS doesn't support symbolic links but DJGPP emulates them.
This function checks if filename is a DJGPP symlink and
the file name that the links points to is copied into buffer,
up to maximum size characters.
Portable applications should not assume that buffer is
terminated with '\0'
.
Number of copied characters; value -1 is returned in case of
error and errno
is set. When value returned is equal to
size, you cannot determine if there was enough room to
copy whole name. So increase size and try again.
not ANSI, not POSIX
char buf[FILENAME_MAX + 1]; if (readlink("/dev/env/DJDIR/bin/sh.exe", buf, FILENAME_MAX) == -1) if (errno == EINVAL) puts("/dev/env/DJDIR/bin/sh.exe is not a symbolic link.");
Go to the first, previous, next, last section, table of contents.