В чем разница между атрибутом «только для чтения» и флагом «только для чтения» в Windows?

957
NobleUplift

Я ищу технический ответ, а не общий ответ, касающийся того, как Windows на самом деле обрабатывает эти свойства. Например, есть некоторые программы, которые распознают атрибут «только для чтения», а другие полностью его игнорируют.

1

1 ответ на вопрос

3
Keltari

A program can not ignore the read-only attribute. Simply put, the file system, the underlying mechanic, will not let you modify or delete a file if the read-only attribute is set. Now, you say there are programs that appear to "ignore" this attribute, and I have seen this in a few programs. However, it only appears to ignore this flag. In reality, as long as the program is launched with sufficient file system privileges by the user, or a run-as command, the program can detect, remove, and reset the read-only attribute while working on the file. Also, in order to modify the read-only attribute, you must have sufficient modify/write privileges (ACL) to modify the file.