I have two applications I'm loading on a BlackBerry, one is a native application, the other is a PhoneGap / Cordova based application.
These two applications share a settings file: file:///store/home/user/myfile.txt
To access this file via Cordova, I call:
fileSystem.root.getFile("home/user/myfile.txt", null, gotFileEntry, fail);
However, on some devices fileSystem.root
returns the SDCard directory, not the internal memory where the file is stored, so I get a FileNotFound
error.
I've tried calling fileSystem.root.getParent(gotParent, fail);
, hoping to get the root of the filesystem, then get the file from internal memory like so:
parentDir.getFile("store/home/user/myfile.txt", null, gotFileEntry, fail);
But that doesn't work either, I still receive a file not found error.
How can I get the root directory of the internal memory every time, using PhoneGap/Cordova?