Delete assets at runtime

While using a butiful console command “record animation” I am creating new animation assets in desired folder. The question is - How can I delete this assets while playing?

I tried this code, but it doesn’t delete anything whatever name/path I’m trying to feed it:

#include "Time.h"
#include "MyBlueprintFunctionLibrary.h"
#include<stdio.h> 


bool UMyBlueprintFunctionLibrary::DeleteAsset(FString FileToDelete)
{
	if (remove("FileToDelete") != 0)
		return 0;
	else
		return 1;
}

Blueprint code runs on level start:

Well, just looking at your function, the code is not using the input FString, rather using just the same string “FileToDelete”.
Maybe, you code should be

if (remove(FileToDelete) != 0)

As a result, the function remove() takes the FString that is in input, rather than a hard coded string.

Let me know if this was your problem, or if you have any other question.