in reply to UNIX File Permissions equal or less than conditions

Bitwise Negate 0755 into 0022. Bitwise-and your test value with 0022. If the result is not zero, then the test value has scary bits set and the permissions test should fail.

Next take your required bits 0750 (?) and bitwise and them with your test value. If the result is not 0750 then the test value has insufficient bits set and the permissions test should also fail.

Otherwise, it passes.

  • Comment on Re: UNIX File Permissions equal or less than conditions

Replies are listed 'Best First'.
Re^2: UNIX File Permissions equal or less than conditions
by kennethk (Abbot) on Sep 17, 2013 at 21:21 UTC