CHMOD question
Posted: Sat Dec 03, 2005 6:42 pm
I have a files permission bits as 666 (decimal)
Read/Write for Owner, Group and Other are all set...
I need to programatically detemrine if Read/Write Owner is set...
Can this be done using a bitwise operation??? If so...can you show me how???
I have tried a simple (666 & 400) == 400
But this doesn't work...
Basically I need a way programatically to take a permission bits and determine which permissions they apply too...
Anyone???
Thanks
Read/Write for Owner, Group and Other are all set...
I need to programatically detemrine if Read/Write Owner is set...
Can this be done using a bitwise operation??? If so...can you show me how???
I have tried a simple (666 & 400) == 400
But this doesn't work...
Basically I need a way programatically to take a permission bits and determine which permissions they apply too...
Anyone???
Thanks