Re: Deleting folder and files from Cpp ?

#2
I don't see any implementation of a "Delete Absolute Directory" method in CryEngine. It must be something in the assets folder. May be missing something of course but to me it sounds like more of a safe-guard using the CryPak interface.

So no, you can however get the project directory and use PathUtil to append the folder eg;

Code: Select all

void CGamePlugin::OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam) { switch (event) { case ESYSTEM_EVENT_FULL_SHUTDOWN: case ESYSTEM_EVENT_FAST_SHUTDOWN: { string logsFolder = PathUtil::Make(gEnv->pSystem->GetIProjectManager()->GetCurrentProjectDirectoryAbsolute(), "logbackups"); // Delete folder code here... (depends on platform or c++17 support) }break; ...
Be careful deleting folders using native functions! Make sure you check 100% you are deleting the exact folder. Seriously.
Uniflare
CRYENGINE Community Coordinator
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Who is online

Users browsing this forum: No registered users and 1 guest