After cached file is saved to disk, File.Exists can't find the file

Discussion and help for Easy Save 3
Post Reply
LiquidEggProduct
Posts: 3
Joined: Thu Jan 20, 2022 3:52 am

After cached file is saved to disk, File.Exists can't find the file

Post by LiquidEggProduct »

Trying to use caching, and encountering a strange problem. After calling StoreCachedFile(fileName), the file saves on the drive, clearly visible in Windows Explorer. When trying to load the file with ES3.CacheFile(fileName), the file cannot be found. File.Exists returns false.

If I delete the file from Windows Explorer, and create it manually via a text editor, ES3.CacheFile is able to load it just fine.

Any ideas as to what the issue is?
User avatar
Joel
Moodkie Staff
Posts: 4824
Joined: Wed Nov 07, 2012 10:32 pm

Re: After cached file is saved to disk, File.Exists can't find the file

Post by Joel »

Hi there,

Assuming your file names match in both calls, this sounds like an OS issue. Please could you send me a script which I can drop into a new scene in a new project which replicates this so I can test it at my end?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
LiquidEggProduct
Posts: 3
Joined: Thu Jan 20, 2022 3:52 am

Re: After cached file is saved to disk, File.Exists can't find the file

Post by LiquidEggProduct »

Thanks, Joel, for the quick response.

I tried directly writing the file content using .NET classes directly instead of ES3, but with the same result. So, it's not a ES3 issue. I'll have to figure out what's happening on my system!
LiquidEggProduct
Posts: 3
Joined: Thu Jan 20, 2022 3:52 am

Re: After cached file is saved to disk, File.Exists can't find the file

Post by LiquidEggProduct »

It turns out, the issue was my misuse of TextMeshPro in the save code. I was passing the wrong class (TextMeshProUGUI rather than TMP_InputField), one of which has a zero-width space at the end of the .text property, and the other did not :lol:
User avatar
Joel
Moodkie Staff
Posts: 4824
Joined: Wed Nov 07, 2012 10:32 pm

Re: After cached file is saved to disk, File.Exists can't find the file

Post by Joel »

Glad you managed to resolve your issue 🙂

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply