- Home /
 
               Question by 
               ajketan · Dec 03, 2014 at 06:37 AM · 
                resources.loadtextassetsystem.iofilestreamstreamreader  
              
 
              What is better for text reading and writing?
What is better for text reading...
         TextAsset content = Resources.Load("tempTextFile") as TextAsset;
         string tempString = content.text;
or Using System.IO operations
         using (FileStream fs = new FileStream(path, FileMode.Open))
             {
                 using (StreamReader reader = new StreamReader(fs))
                 {
                     string tempString = reader.ReadToEnd();
                     reader.Close();
                 }
                 fs.Close();
             }
The thing is that I need to write back in to the file as well.... for that I eventually have to use System.IO operations ... or is there a way in unity libraries for achieving that as well?
               Comment
              
 
               
              Answer by DiebeImDunkeln · Dec 03, 2014 at 06:47 AM
I think in the first line it depend on which system your game should run. For mobile and read only I would prefer Resources.Load because I think you could get perhaps some trouble with a streamreader on an IPhone.
Your answer
 
 
             Follow this Question
Related Questions
IO reading file problem 1 Answer
Trouble with Resources.Load 1 Answer
Issues with TextAsset , Resources.Load , and mp3 audio 0 Answers
searching particular word in text file.? 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                