Questions tagged [binary-flags]

A binary flag is a binary number that is used to indicate that a single switch in a binary-word is on or off; Along with another binary number called a binary mask the two can have a binary AND operation applied to it to determine if the flag is on or off.

Querying the Status of a bit:

It is possible to use bitmasks to easily check the state of individual bits regardless of the other bits. To do this, turning off all the other bits using the bitwise AND is done as discussed above and the value is compared with 0. If it is equal to 0, then the bit was off, but if the value is any other value, then the bit was on. What makes this convenient is that it is not necessary to figure out what the value actually is, just that it is not 0.

    Example 1  Example 2
    10011101   10010101  <- Binary Flags
AND 00001000   00001000  <- Bit Mask
  = 00001000   00000000  <- Bit Status (on or off)

Source Wikipedia

2 questions
1
vote
0 answers

Where can I find an "Access Mask Format" for POSIX and ACL permissions in Linux?

I was looking at NTFS file permissions yesterday, and they have an Access Mask Format for their low level permissions and it's stored in an enumeration in binary, which got me wondering about if there is a similar document on POSIX and ACL…
leeand00
  • 4,443
  • 10
  • 51
  • 78
0
votes
2 answers

Window Manager: Add the maximize option to any window (even if the UI disabled the option)

Some graphical programs make use of a window which the user can scale unlimitedly but still disable the maximize option (for whichever dumb reason). [EDIT]: The window might be a subwindow of another window (don't know the technical term), and it is…