Subject: Re: sys/stat.h: S_IFLNK
To: None <tech-misc@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-misc
Date: 01/09/2001 17:18:38
In article <3A5B343C.2E1B4044@ifm.liu.se>,
Thorbjorn Jemander <thoan@ifm.liu.se> wrote:

Does the stat syscall fail? Also you should
be using S_ISLNK(file_stat.st_mode) for
portability.

christos

>
>So, here's some really basic stuff.
>Why do regular files trigger this test:
>
>if (file_stat.st_mode & S_IFMT == S_IFLNK) {
>	/* Symbolic link */
>}
>
>?
>
>With "regular" files I mean ordinay textfiles
>and executables. Anyhow, I can't understand
>why they would be reported as symlinks?
>
>I must be missing something very obvious here,
>but I can't see what it is.
>
>/Thorbjörn