471,573 Members | 1,672 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,573 software developers and data experts.

Symbolic links

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
Oct 10 '06 #1
4 3223
TK <to****@web.dewrote:
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
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Oct 10 '06 #2
TK wrote:
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.
Oct 10 '06 #3


On Oct 10, 7:39 pm, TK <tok...@web.dewrote:
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."

Oct 10 '06 #4
TK
TK wrote:
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
Oct 10 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark Everett | last post: by
22 posts views Thread by mp | last post: by
reply views Thread by humbleaptience | last post: by
1 post views Thread by Remote_User | last post: by
1 post views Thread by amygrant1701 | last post: by
2 posts views Thread by Desmodromic | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.