By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,403 Members | 880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,403 IT Pros & Developers. It's quick & easy.

Symbolic links

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a


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

P: n/a
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.