I’m trying to obtain the absolute file path of the directory in which my code is running. The two lines in the picture where I initialize a Path and then print it should do it, but it’s not working for some reason.
Expected output: “Current absolute directory: /storage/emulated/0/AppProjects/DnDCharacterSheet/src/”
Actual output: “Current absolute directory: /”
I’ve tried a few other ways to get the absolute path too, and all of them just return “/” instead of the actual path. How can I get the absolute directory so that I can read in my text file without having to hardcode its file path?