Posted on 1997-05-01
Here is the text of my posting on comp.lang.pascal.delphi.misc:
I'm hoping this is trivial and that I've just overlooked something
obvious, but here's my problem:
I'm looking to clear out and delete directory structures from Delphi
and I've run into the limitation that RmDir only works on empty
directories. I can write a batch file to perform the function in DOS
and do it that way but then I get an annoying black screen flash. I
implemented a TFileListBox component to first delete all the files
in a directory but then the RmDir fails because it says that the
directory is busy. I've tried freeing the TFileListBox before doing
this but it didn't seem to help. It might also be complicated by
the fact that I've compiled this as a DLL and so the caller app
might somehow be tying the file up...
Anyway, is there an easier way all around to do this?
I sure hope so... Thanx in advance for any advice y'all have...
I received one good response from Rod Geraghty
(GERA-Tech - Ottawa, Canada -firstname.lastname@example.org)
which recommended I use the SHFileOpStruct structure
to move, rename or delete entire directories...
Unfortunately this seems to work only for Windows95 and
not to be an option for NT.
Thanks in advance...