0

I want to create file using the PhoneGap API File Writer, but using data my file will create in root folder either memory card or phone memory, but actually I want to create that file. Where does my installed app go? How do I know that where my files are installed and how do I create a file at that location?

Here is what I have:

function onDeviceReady() {
    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}

function gotFS(fileSystem) {
    fileSystem.root.getFile("readme.txt", {create: true, exclusive: false}, gotFileEntry, fail);
}
Andrew Lively
  • 2,145
  • 2
  • 20
  • 27
Blu
  • 4,036
  • 6
  • 38
  • 65

1 Answers1

0

See this last comment. So you can try to get /data/yourApp folder via fileSystem.root.getDirectory() etc. if it exists - so you are on sd card. go to the /data/yourApp and write there. If it doesn't exists - the root is already you app folder - just write the file.

Community
  • 1
  • 1
lavrik
  • 1,456
  • 14
  • 25