D
Deniz Dogan
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.
/Deniz Dogan
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.
/Deniz Dogan