- Home /
 
 
               Question by 
               zardini123 · Jan 23, 2013 at 01:28 AM · 
                sizefilereading.txt  
              
 
              Reading a file's memory size
Is there a way to read a .txt file memory size? (Example: .txt file is 1.2 MB)
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by DeveshPandey · Jan 23, 2013 at 09:36 AM
Hi,
Its very simple try this:
 string filePath = "C:\\file.txt"; // it may audio,video file
 FileInfo info = new FileInfo(filePath);
 Debug.Log(info.Length+" Bytes");
 
              You should be able to infer that from his answer, it's not that difficult. The most important part is that the length is in the "Length" field of a FileInfo object you need to create from the path.
Your answer
 
             Follow this Question
Related Questions
.txt File Bug 3 Answers
How to reduce apk size to its minimum? 6 Answers
file size ios too big 0 Answers
How do I get file size of texture? 1 Answer
reduce unity mac standalone file size 0 Answers