With c code, I want to know the given file (like test.c) is a symbolic link or not. I tried with stat() function. I am checking the
nlink_t st_nlink; /* number of hard links */
member of stat structure.
struct stat stbuf;
stat("test.c", &stbuf)
stbuf.st_nlink
is giving one in case of hard link as well as in softlink.
Is that i am doing right. Or is there any other way to check the given file is a soft link or hard link.