Hello, I was wondering how i keep getting this error and tried looking it up and got no results! I has hoping that someone could help me. This is the error:
IOException: Sharing violation on path C:\sdcard\Square\Highscores.data System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/FileStream.cs:320) System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/StreamWriter.cs:124) System.IO.StreamWriter..ctor (System.String path) (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string) Highscores+$WriteToFile$59+$.MoveNext () (at Assets/Scripts/Highscores.js:98)
and here is the Write To File code:
function WriteToFile(TextToWriteA: String) { var TextToWrite: String[] = TextToWriteA.Split(" " [0]); if (System.IO.File.Exists(FilePath + FileName)) {} else { System.IO.File.Create(FilePath + FileName); } yield WaitForSeconds(1); var sw: StreamWriter = new System.IO.StreamWriter(FilePath + FileName); for (var i = 0; i < TextToWrite.length; i++) { sw.WriteLine(TextToWrite*);* _StringToWrite += TextToWrite*;*_ _*}*_ _*sw.Close();*_ _*}
_
_----------*_
Thanks in Advance!