I cant delete the file on game

Discussion and help for Easy Save 3
Tanoshimi
Posts: 11
Joined: Thu Oct 07, 2021 4:25 pm

Re: I cant delete the file on game

Post by Tanoshimi »

Any chance we can get a ClearSaves() function that might delete the cache and the file? I was surprised when I deleted the SaveFile.es3 from my directory and it still loaded the data. Now I get why, but that's kinda interesting behavior.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: I cant delete the file on game

Post by Joel »

Hi there,

This script will add ES3Tools.DeleteFileFromAllLocations() and ES3Tools.DeleteFileFromAllLocations(string filePath) methods to your project.

Code: Select all

public static class ES3Tools
{
    // Deletes the default save file from disk and cache.
    public static void DeleteFileFromAllLocations()
    {
        ES3.DeleteFile(new ES3Settings(ES3.Location.File));
        ES3.DeleteFile(new ES3Settings(ES3.Location.Cache));
    }

    // Delets the file with the given name or path from disk and cache.
    public static void DeleteFileFromAllLocations(string filePath)
    {
        ES3.DeleteFile(filePath, new ES3Settings(ES3.Location.File));
        ES3.DeleteFile(filePath, new ES3Settings(ES3.Location.Cache));
    }
}
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply