What directory do objects of the File() class look in?

39 views Asked by At

I have a project in Aide (for Android) that compiles code that is written in Java.

I would like to check and see if a file on my phone exists and noticed that when I use code that reads the existing file (using 'Istream.open() and Istream.read()' inside a thread), I don't have to specify the current working directory, but when I use File.exists(), I do.

I tried printing System.getProperty("user.dir") and got just a backslash '', but KNOW that the current working directory, is NOT the root directory of my phone.

In the meantime, I tried putting the directory that I THINK all the files that uses the 'File = new 1File(filename)' class are stored in (placing the directories before the filename). I tried things like...

project name+"\app\assets\"+filename,
"\"+project name+"\app\assets\"+filename,
project name+"\assets\"+filename,
"\"+project name+"\assets\"+file1name,

Nothing seemed to work.

0

There are 0 answers