ES2.DeleteDefaultFolder throws sharing violation

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
frikic
Posts: 8
Joined: Thu Nov 06, 2014 9:36 am

ES2.DeleteDefaultFolder throws sharing violation

Post by frikic »

Hi,

Ive been using ES2 and did not had this problem before, but I guess that changing to newer unity version cause it.
So while in game calling ES2.DeleteDefaultFolder(); will give sharing violation of file output_log.txt which is Unitys
log file. I understand that game is running and it needs log file and cant allow for it to be deleted, so what could
be solution for this problem?

Cheers
Milos
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES2.DeleteDefaultFolder throws sharing violation

Post by Joel »

Hi Milos,

I've not seen that before. A workaround would be this:
var files = ES2.GetFiles(Application.persistentDataPath + "/");
foreach(var file in files)
{
    if(file != "output_log.txt")
        ES2.Delete(file);
}
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
frikic
Posts: 8
Joined: Thu Nov 06, 2014 9:36 am

Re: ES2.DeleteDefaultFolder throws sharing violation

Post by frikic »

Thanks! that worked, well it does not happen in Editor, I get the error only from the build.
Locked