I have decided to locate my data folder for a game I am making in the Documents folder. I am currently going through the quick process of translating from Mac to Windows, where I am having issues finding the document using the same path. I find the path like this:
String path = "c:/Users/" + System.getProperty("user.name") + "/Documents/gamedata/data.txt";
I checked, and it says that it is looking for the path c:/Users/abcdefg/...
where abcdefg is my user.name, but the actual path that I want it to find is c:/Users/abcd/ because that is what the folder is called for some reason. I'm not sure why this is happening. The reason I don't manually set path
to be the path is because I want my friend to run the game and automatically find the data file.
I have tried: changing the path, trying to find another System.getProperty
. I don't want to rename my Users folder because I am worried that might break something.
Let me know if yall know a way to fix this. In the meantime, I might consider moving the folder to be in the root folder, so the path is easily just c:/gamedata/data.txt
. Thank you in advance for any help I might get!