Symbolic links

T

TK

Hi,

I have to know whether a typical file (under Linux) a symbolic link is
(in the sense of the stat()-Funktion). How can I check it excactly?

Thanks for help.

o-o

THomas
 
J

Jens Thoms Toerring

TK said:
I have to know whether a typical file (under Linux) a symbolic link is
(in the sense of the stat()-Funktion). How can I check it excactly?

Sorry, but you got the wrong newsgroup: what you are looking for is
a system-specific (and thus non-standard) extension to C and that's
better discussed in the appropriate groups, e.g. comp.unix.programmer
or comp.os.linux.development.apps.

<OffTopic>
Since you already know about the stat(2) function have another look at
its man page and especially check for the S_ISLNK macro to be applied
to the 'st_mode' field of the structure returned by the function.
</OffTopic>
Regardsm Jens
 
?

=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=

TK said:
Hi,

I have to know whether a typical file (under Linux) a symbolic link is
(in the sense of the stat()-Funktion). How can I check it excactly?

Ask in a newsgroup for programming on linux/unix.

In the meantime read man 2 stat, it should teach you how.
 
C

Cong Wang

Hi,

I have to know whether a typical file (under Linux) a symbolic link is
(in the sense of the stat()-Funktion). How can I check it excactly?

Thanks for help.

o-o

THomas

This is off topic here. You'd better post this to comp.unix.programmer.
But your question is easy to answer. You can check the attribute of the
file directly. And do remember: "the C function lstat gives you the
status of a file regardless of whether it's a normal file or a symbolic
link, the stat function follows symbolic links and, if the specified
file was a symbolic link, returns the status of the linked-to file."
 
T

TK

TK said:
Hi,

I have to know whether a typical file (under Linux) a symbolic link is
(in the sense of the stat()-Funktion). How can I check it excactly?

Thanks for help.

o-o

THomas

Thanks for the tipps.

o-o

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top