[SOLVED]File don't save in persistentDataPath

The txt file refuse to save in persistentDataPath and it get saved in project folder or in game folder if build

I have the following code:

if (!Directory.Exists(Application.persistentDataPath + "/Maps"))
            Directory.CreateDirectory(Application.persistentDataPath + "/Maps");

        if (!File.Exists(path + "Level01.txt"))
        {
            TextAsset l01 = Resources.Load("Level01") as TextAsset;

            string data = l01.text.Replace(Environment.NewLine, string.Empty);

            string[] dataArray = data.Split('-');

            //File.WriteAllText(path + "Level01.txt", data);
            StreamWriter sr = new StreamWriter(path + "Level01.txt", true);
            for (int i = 0; i < dataArray.Length; i++)
            {
                if(i == dataArray.Length -1)
                    sr.WriteLine(dataArray[i]);
                else
                    sr.WriteLine(dataArray[i] + "-");
            }
            sr.Close();
        }

If I change to dataPath it refuse to create folder.
Anyone have any idea what is happening ? I use the latest version of unity 2019

It seems unity dont like

path = Application.persistentDataPath + "/Maps/";

I had to change it to

path = Application.persistentDataPath + "/Maps";

Use Path.Combine to avoid this kind of issues.

ok, I will do it. thank you

how to save image from url to a resource folder using csharp in unity