stat system call mode checking
Hello,
I am writing a part of the problem code : Can anybody tell me what is wrong in this code ?
if (st.st_mode != (S_IFCHR | S_IRUSR | S_IWUSR | S_IWGRP)) {
printf("Mode is not set for the device\n");
printf("Actual mode = %o\n",st.st_mode);
}
Is the comparison correct ?
mode of the device is 777.
printf always prints : Actual mode =0620 even if i change the mode of the device using chmod from command line.
Why is this ?
Regards,
ppy
|