Removing readonly files on windows with std.file

Dominikus Dittes Scherkl dominikus at scherkl.de
Sat Mar 7 22:51:46 UTC 2020


On Saturday, 7 March 2020 at 20:01:07 UTC, Jonathan Marler wrote:
> We could modify std.file.remove to be able to remove readonly 
> files, but maybe there's use cases where people want the 
> removal to fail if it is marked as readonly?

I always thought "readonly" was intended to protect from 
"modification" not from "deletion", so simply making the function 
consistent with the explorer would be the right thing to do.
It's like a "const" variable: you cannot change its value, but of 
course you should be able to free the memory it occupies if it 
goes out of scope or is otherwise detectable not used anymore.


More information about the Digitalmars-d mailing list