Archive: Delete and file access rights


Delete and file access rights
The doc about Delete says "The error flag is not set from trying to delete a file that does not exist."

But what about Delete on files which are inaccessible ?

For instance, suppose the the C:\foo directory is completely inaccessible (read, write, listing forbidden) and that you try
to "Delete c:\foo\bar.txt".

I think Delete should then set the error flag on this case, but it does not.

Is it by design or is it a bug ?

Thanks,


Not sure, but would IfFileExists work here?

-Stu


Originally posted by Afrow UK
Not sure, but would IfFileExists work here?

-Stu
IfFileExists acts as if the file does not exist. But I think this is also a bad NSIS behavior. Being unable to know if the file exists does not imply that the file does not exists. Only the final application may choose to consider these two cases as equivalent.

Shouldn't an uninstaller fail if it is asked to remove a file it has no access to ?