Afficher un message
Vieux 11/05/2008, 13h05   #1
Deniz Dogan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut with st_mode in sys/stat.h

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 is
appreciated.

/Deniz Dogan
  Réponse avec citation
 
Page generated in 0,07065 seconds with 9 queries