What is dirty bit?
When a bit is modified not written back to the storage it is called as a dirty bit.
Simply the dirty bit is a flag that indicates whether an attribute needs to be updated or not.
Well, the above was the definitions
Let’s understand in simple with an example what is a dirty bit.
How MS-word detects changes in the document and asks to save?
Let you opened an MS-word document and made some changes to it. Then while closing the window it asks to save.
So how it detects that you have made some changes?
Yes, dirty bit plays it’s role here.
When we are opening a document its default data bit is 0 but when we are making some changes then the dirty bit value changes to 1.
So it feels something needs to be written in the storage and shows a dialogue box to save the changes.