Page 1 of 1

DeleteFile with force flags

Posted: Fri Feb 10, 2012 12:09 am
by ctg
G'day, just a quickie.

May the #PB_FileSystem_Force flag please be added as an option to DeleteFile, or DeleteFile and DeleteDirectory me merged into the one function? I can use DeleteDirectory to remove read-only files but it's not really logical.


Cheers.

Re: DeleteFile with force flags

Posted: Fri Feb 10, 2012 12:20 am
by IdeasVacuum
.... I think that might be difficult to achieve as a general command, at least on Windows (possibly even more so on Windows8). DeleteFile() will already delete deletable files. Files that won't delete will be locked in some way, either because they are opened and in use by another app or because the OS needs them to stay alive. Even the file unlock apps available cannot always delete a file, they merely record it's name and delete it on startup/reboot.

Re: DeleteFile with force flags

Posted: Sun Feb 12, 2012 11:12 pm
by ctg
IdeasVacuum wrote:.... I think that might be difficult to achieve as a general command, at least on Windows (possibly even more so on Windows8). DeleteFile() will already delete deletable files. Files that won't delete will be locked in some way, either because they are opened and in use by another app or because the OS needs them to stay alive. Even the file unlock apps available cannot always delete a file, they merely record it's name and delete it on startup/reboot.
I understand your point regarding locked files, but read-only files aren't inherently locked by the OS. :wink: