Symbolic links

Discussion in 'C Programming' started by TK, Oct 10, 2006.

  1. TK

    TK Guest

    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
    TK, Oct 10, 2006
    #1
    1. Advertising

  2. TK <> wrote:
    > 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 ___
    \__________________________ http://toerring.de
    Jens Thoms Toerring, Oct 10, 2006
    #2
    1. Advertising

  3. 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.
    =?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=, Oct 10, 2006
    #3
  4. TK

    Cong Wang Guest

    On Oct 10, 7:39 pm, 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


    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."
    Cong Wang, Oct 10, 2006
    #4
  5. TK

    TK Guest

    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
    TK, Oct 10, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim
    Replies:
    4
    Views:
    6,978
  2. Juha Laiho
    Replies:
    0
    Views:
    658
    Juha Laiho
    Jul 20, 2004
  3. Nick Howes
    Replies:
    6
    Views:
    560
    Toby A Inkster
    Nov 24, 2003
  4. pekka.niiranen
    Replies:
    0
    Views:
    255
    pekka.niiranen
    Feb 10, 2004
  5. mp
    Replies:
    24
    Views:
    813
    Floyd L. Davidson
    May 3, 2006
Loading...

Share This Page