Delete folder (and subfolders)?

Blitz3D Forums/Blitz3D Programming/Delete folder (and subfolders)?

John Blackledge(Posted 2005) [#1]
I've looked through the code archives but I can't see anything that will do the job.

Does anyone have any code that can delete a folder (including all files, and subfolders and their files)?

Basicaly the Blitz equivalent of 'DelTree'.


WolRon(Posted 2005) [#2]
Write your own function.


Farflame(Posted 2005) [#3]
Yeah, it looks like you have to run through the folder and do a deletefile on each file, then a deletedir when the folder is emptied :/


BlackJumper(Posted 2005) [#4]
It would have to be recursive (calling itself) if the folder contains any sub-folders


RGR(Posted 2005) [#5]
You could save the commandline to a batchfile and execfile that: RD /S /Q D:\KeepThisDir\TheDirAndSubdirsToDelete

or write a PureBasic DLL

or get the dll (5kb) from me by email


John Blackledge(Posted 2005) [#6]
Thanks RaGR, that will do the trick nicely.