Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Problem with csv generation on downloaded Mac build

Discussion in 'Scripting' started by PhotinusPyralis, Mar 15, 2020.

  1. PhotinusPyralis

    PhotinusPyralis

    Joined:
    Jun 20, 2018
    Posts:
    2
    Hello, this is a bit of a strange problem
    I'm building an application that writes a csv file (using the code below). It works fine when tested and after I build it to Mac and Windows. I have to then compress the builds and upload both to google drive. I re-download the files from the drive to test if the csv generation works. In Windows, it works fine but in Mac, it gets stuck and doesn't generate any files... Is the code the problem? (I'm sorry, I'm quite new to this)


    Code (CSharp):
    1. using (var file = System.IO.File.CreateText(student + ".csv"))
    2.                {
    3.                     foreach(var arr in finalResults)
    4.                     {
    5.                          if (i%3 == 0) {
    6.                               file.WriteLine(songType_Array.ElementAt(count));
    7.                               count += 1;
    8.                          }
    9.                          file.WriteLine(string.Join(",", arr));
    10.                          i+=1;
    11.                     }
    12.                }
     
  2. PhotinusPyralis

    PhotinusPyralis

    Joined:
    Jun 20, 2018
    Posts:
    2
    Nevermind, I figured it out
     
    Kurt-Dekker likes this.