How to delete a directory?

Hello,

I create a directory with TSystem::mkdir() (it lacks an uppercase!). How to delete it ?
Is there a method in TSystem or somewhere else to do so ?

Thank you
Barth

See TSystem::Unlink(const char* name)

Cheers, Bertrand.

Hi Bertrand,

Thanks, I missed this one.

May I suggest to add an “alias” method with a meaningful name such as “RemoveFile” ?

Cheers,
Barth

Hi again,

If the directory is not empty it fails. I guess I have to manually clean it up beforehand ? or is there another method for that ?

Thank you very much
Barth

Well, in any case you can still use gSytstem->Exec("rm -rf your_directory_name");
Cheers, Bertrand.

gSytstem->Exec("chmod -R a+rw your_directory_name; rm -rf your_directory_name");

:mrgreen:

Thank you Bertrand, I will do this… :slight_smile:

Barth