Consider the below code -
FileInfo fileInfo = new FileInfo("C:\\doesNotExist.txt");
Console.WriteLine(fileInfo.Attributes);
Console.WriteLine(fileInfo.Attributes.HasFlag(FileAttributes.ReadOnly));
As per the documentation, the default underlying type for an enumeration is int and an int with a value of -1 is basically all 1s in binary. Since, FileAttributes allows a bitwise combination of its member values (as stated here), why is the default value for FileAttributes -1 as it would mean that a file which does not exist possesses all possible FileAttributes (the above code prints True for the third line)