On 11 Maj, 13:21, Spiros Bousbouras wrote:
> On 11 May, 12:05, Deniz Dogan wrote:
>
> > Hello.

>
> > I have a question regarding the st_mode field of the "stat" struct in
> > sys/stat.h. I'd like to know how to use the S_IRWXU, S_IRWXG and
> > S_IRWXO flags to mask the mode_t value into human readable form such
> > as 755, 644, etc. Currently I do something similar to this:

>
> > usr_t = (mod & S_IRWXU);

>
> > usr_r = (mod & S_IRUSR);
> > usr_w = (mod & S_IWUSR);
> > usr_x = (mod & S_IXUSR);

>
> > However, this does not produce the required result. Any help is
> > appreciated.

>
> We only deal with standard C here. For this sort of
> question you should go to comp.unix.programmer


I'll do that. Thanks.