file or directory and st_mode

Discussion in 'C Programming' started by a, Oct 23, 2005.

  1. a

    a Guest

    struct stat* buf
    buf->st_mode

    Is there any marco can construct the type and permission string, like
    drwx------, by passing the st_mode?
    Thanx
    a, Oct 23, 2005
    #1
    1. Advertising

  2. a

    Michael Mair Guest

    a wrote:
    > struct stat* buf
    > buf->st_mode
    >
    > Is there any marco can construct the type and permission string, like
    > drwx------, by passing the st_mode?


    Note that there are no directories from the standard C point of view.
    struct stat is not known to me, neither is st_mode, the code does not
    compile, no source is provided: This cannot be answered.

    Learn how to ask smart questions:
    http://www.catb.org/~esr/faqs/smart-questions.html

    Hint: If your answer solely depends on what st_mode can contain,
    then you should state what it contains, otherwise mention all
    additional conditions.

    If there is not a very clear and obvious relationship between
    the desired string and st_mode, I would rather use a function
    than a macro.


    Cheers
    Michael
    --
    E-Mail: Mine is an /at/ gmx /dot/ de address.
    Michael Mair, Oct 23, 2005
    #2
    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. TJS
    Replies:
    1
    Views:
    513
    Eliyahu Goldin
    Jun 23, 2004
  2. =?Utf-8?B?QmFzIEhlbmRyaWtz?=

    Directory and files names in temporary asp.net directory

    =?Utf-8?B?QmFzIEhlbmRyaWtz?=, Jan 28, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    838
    Juan T. Llibre
    Jan 31, 2005
  3. electric sheep

    readdir() and S_ISDIR(stat.st_mode) question (OT ?)

    electric sheep, Mar 4, 2004, in forum: C Programming
    Replies:
    2
    Views:
    11,511
    Villy Kruse
    Mar 4, 2004
  4. John

    stat.st_mode deciphering

    John, Jun 19, 2004, in forum: C Programming
    Replies:
    1
    Views:
    727
  5. Deniz Dogan

    Help with st_mode in sys/stat.h

    Deniz Dogan, May 11, 2008, in forum: C Programming
    Replies:
    3
    Views:
    859
Loading...

Share This Page