IOException Error

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
Calandryll
Posts: 4
Joined: Sun Dec 10, 2017 8:12 am

IOException Error

Post by Calandryll »

Hi! I've been using Easysave for my game and it's been awesome! My game saves a lot of data, so saving often takes about 2-3 seconds to finish. Which is fine for when the player saves and leaves the game.

However, in working on using it as an auto-save and moving it to a separate thread so that the delay doesn't impact gameplay, I get this error:

IOException: Sharing violation on path... and then it lists the path and the safe file.

The save DOES seem to work, however I'm reluctant to push this change live with an error like that. Is there anyway to facilitate a save on a separate thread without getting this error?

Thanks!

Edit: forgot to add that I am using version 2.8.3
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: IOException Error

Post by Joel »

Hi there,

Easy Save isn't officially supported in a separate thread because much of Unity's API isn't thread safe.

However, if you do decide to use it outside the main thread (many people do with no issues), you will need to make sure that Easy Save is only used in one thread at a time. You should not save to/load from multiple files at the same time.

If you're not already doing so, you might find that using an ES2Writer/ES2Reader will improve performance significantly, rather than using a separate thread: http://docs.moodkie.com/easy-save-2/gui ... es2reader/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Calandryll
Posts: 4
Joined: Sun Dec 10, 2017 8:12 am

Re: IOException Error

Post by Calandryll »

Thank you, I will check that out!
Locked