I'm confused by this condition.  Surely what you want is `(sb.st_mode & 0700) != 0`, which is easily read as testing whether the bit set by the chmod below is clear.  What you've written leaves me wrestling with it to make sense of what it means: apparently,
* `UINT_MAX == (sb.st_mode ^ ~0700)` iff
* "every bit of (sb.st_mode ^ ~0700) is set" iff
* "sb.st_mode's 0700 bit is set and no other bits of it is set" iff
* "sb.st_mode == 0700"

which would appear to be about as far from the right condition as possible, but perhaps I just misunderstood.  In any case, a simple expression whose meaning *doesn't* involve mind-bending bit-frobbling (that I either misunderstood, or that tests the wrong condition) is surely preferable.