Delete folder not empty C++
Hi, I'm using rmdir(), and everything goes ok if the directory is empty, ¿how can I remove the entire tree when i have other files or directories in the folder that I want to delete?
I've read about using "system(rm....)" but i REALLY want to do this without it, is it possible? Any help is very appreciated! Thanx a lot! |
I dont think there is a standard C++ or UNIX call to do this. Simply iterate over all files and delete them; recursively deleting the files within subdirectories. I believe its easier than you may be thinking it is.
|
how bout
Code:
#define DELETE_DIR(x) do {char b[255]; sprintf(b, "rm -r %s", (x)); system(b);} while(!1) |
I think he/she didnt want to use any "system" calls.
|
Quote:
|
All times are GMT -5. The time now is 11:54 PM. |