Is it safe to use System.IO when working with files in Unity3d?

I am writing a game that needs to access a file. That is, he must write to the file and read it. The question is, can I use classes System.IOwithout worrying about problems that might arise due to platform incompatibility.

Are these methods supported regardless of the platform the game is running on? If not, is it possible to work with files regardless of platform?

+4
source share
1 answer

Yes, they work no matter where you run it. Speaking from my own experience, I have no idea why this could be otherwise.

. , . , , (: Path.GetTempPath()). (.. "Mydir/myanotherdir" ), . , ( - http://www.mono-project.com/docs/advanced/iomap/), - linux. :

  • . - , ( ), (, Path.GetTempPath, AppDomain.CurrentDomain.BaseDirectory) ..
  • (Path.Combine, Path.DirectorySeparatorChar ..). .
+1

Source: https://habr.com/ru/post/1607163/


All Articles