Re: stat() problems.

"Alexandre P. Nunes" <[email protected]>
Newsgroups org.kernel.vger.linux-gcc
Message-ID <[email protected]>
Stefanos Koutsoutos wrote:

>Hi,
>
>I'm facing problems with stat() system call. It seems that it follows
>filesystem links! To be more accurate I try:
>
>struct stat buf;
>stat("this_is_a_link", &buf);
>
>and then:	S_ISLNK( buf.st_mode )  is false!
>
>More, the mode is the same as the mode of the file it links to! I think
>that this is not what it supposed to be done by stat(). Any ideas??
>
>Thanks in advance.
>Stefanos.
>
>  
>

stat() follows symlinks. That's why there's lstat(), try it instead.

Cheers,

Alexandre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.