Page 1 of 1

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

Posted: Thu Jan 20, 2022 4:07 am
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?

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

Posted: Thu Jan 20, 2022 9:03 am
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

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

Posted: Sat Jan 29, 2022 4:38 am
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!

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

Posted: Sat Jan 29, 2022 5:39 am
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:

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

Posted: Sat Jan 29, 2022 12:29 pm
by Joel
Glad you managed to resolve your issue 🙂

All the best,
Joel