Cannot remove directory
-
Hi all, In a program I use "RemoveDirectory (LPCTSTR szName)" to remove a directory. However, this never seems to work. GetLastError () claims that "the process cannot access the file because it is being used by another process", which is not the case. I have no problem in removing the same directory from either a command-line or from the explorer. I am sure that the directory is empty (this is done in a preceeding bit of code in the same program). Anyone any ideas? Thanks in advance, William
-
Hi all, In a program I use "RemoveDirectory (LPCTSTR szName)" to remove a directory. However, this never seems to work. GetLastError () claims that "the process cannot access the file because it is being used by another process", which is not the case. I have no problem in removing the same directory from either a command-line or from the explorer. I am sure that the directory is empty (this is done in a preceeding bit of code in the same program). Anyone any ideas? Thanks in advance, William
-
Wim Engberts wrote:
I am sure that the directory is empty (this is done in a preceeding bit of code in the same program).
A missing FindClose(), maybe?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
You are absolutely right! Never thought I'd need that after FindNext returned FALSE! Thank you very much. William
-
You are absolutely right! Never thought I'd need that after FindNext returned FALSE! Thank you very much. William