The attributes property of a file object is a bit field presented as a number and given an easily understandable value by the System.IO.FileAttributes enumeration.
Bit fieldsA bit field is a means of exposing multiple settings that have two states (on or off binary states) using a single number.
A byte, an 8-bit value, can therefore hold eight possible settings. A 32-bit integer, 4-bytes long, can hold 32 different settings.
The following table, whose state is described by 4 bits, has four settings:
Name: Setting4 Setting3 Setting2 Setting1
State: On Off On Off
Binary: 1 0 1 0
Decimal: 8 4 2 1
When settings 2 and 4 are toggled on, the value of the field is the conversion of 1010 to decimal. This value ...