Hi !
I’d like to open a file in a text editor (whichever one the user chooses/has). None of that Filestream to read line by line and write stuff, just bring me to the editor and show me the file.
I’ve tried this :
string dataPath = Application.streamingAssetsPath+ "/somedoc/" + fileName;
Application.OpenURL(dataPath);
The code above doesn’t do anything (doesn’t trigger anything in the debug log or do anything). Debugging to check if System.IO.File.Exists(l_DataPath) returns false. Thing is, I’m using pretty much the same path for iOS and PC and it works.
Other things I’ve tried :
-
Changing the path to Application.dataPath and Application.persistentDataPath doesn’t work more. The Exists() check still returns false, but this time around a popup comes up asking me with what editor I want to open the file. Whatever I choose, once I open up the editor, it just tells me he’s unable to load the file or something.
-
Adding “file://” or “file:///” before the path. Didn’t change a thing.
I’m kind of out of ideas here ! Anyone knows how to achieve this ?
BONUS QUESTION : Should I finally be able to make the above work, is there a way to open the text file in readonly mode ?
Thanks for anyone taking the time to help me out !