DeleteDir will not remove the directories
Posted 05 August 2002 - 18:58
I use the commands:
SetFileInfo(sPath, FILE_ATTRIBUTE, FILE_ATTR_SYSTEM, sNULL);
DeleteDir ( sPath , ALLCONTENTS );
but the directory still exists.
I also use the command DeleteDir twice.
What can I do to delete the directories? They are empty.
Thanks for help.
Posted 06 August 2002 - 12:41
one reason may be:
if you happened to use FindAllFiles(...) before to browse through a directory, you cannot remove this directory unless you "released" it: call FindAllFiles again but now with CANCEL as last parameter. Now, the directory is removable with DeleteDir(...).
you changed to this directory and stand just in it. Change to a different directory then and remove it afterwards.
Posted 06 August 2002 - 16:00
By the way, I have found the reason why I can not delete the directories:
The directories are already in use from a dll which the installation starts, but I haven't the source to this.
Can I resolve this problem?
Posted 07 August 2002 - 06:21
As long as a DLL locks a directory, the only way to free it is to kill the DLL (DLL as a process).
Can't you delete the directory prior to running the DLL?
Posted 09 August 2002 - 08:16