Which file attribute prevents a file from being modified or deleted accidentally?
Trap 1: Archive
The Archive attribute merely flags a file as changed since the last backup, so backup software knows what to copy; it imposes no write protection whatsoever. It is tempting because it appears in the same attributes list as Read-only, but it serves backup tracking, not accidental modification prevention.
Trap 2: System
The System attribute marks a file as required by the operating system, which is why Windows hides it and warns before deletion; it does not block modification. It is tempting because system files are protected in practise, but that protection comes from permissions, not the attribute itself.
Trap 3: Hidden
The Hidden attribute only removes the file from default directory listings; anyone who enables viewing of hidden files can still modify or delete it freely. It is tempting because hidden files feel protected, but concealment is not access control — Read-only is what blocks writes.
- A
Archive
Why it fails: The Archive attribute merely flags a file as changed since the last backup, so backup software knows what to copy; it imposes no write protection whatsoever. It is tempting because it appears in the same attributes list as Read-only, but it serves backup tracking, not accidental modification prevention.
- B
System
Why it fails: The System attribute marks a file as required by the operating system, which is why Windows hides it and warns before deletion; it does not block modification. It is tempting because system files are protected in practise, but that protection comes from permissions, not the attribute itself.
- C
Hidden
Why it fails: The Hidden attribute only removes the file from default directory listings; anyone who enables viewing of hidden files can still modify or delete it freely. It is tempting because hidden files feel protected, but concealment is not access control — Read-only is what blocks writes.
- D
Read-only
The read-only attribute blocks write and delete operations on a file, directly satisfying the requirement to prevent accidental modification or deletion. Unlike hidden or archive attributes, which govern visibility and backup status respectively, read-only enforces write protection at the file-system level, so edits and deletions fail until the attribute is cleared.