android - Phonegap file writing throws error code 1 -
i trying write file in android using phonegap cordova 1.5.0. below code snippet. snippet working fine in simulator when run on android mobile goes till gotfs() "fail error code" alert of fail() pops message
"fail error code 1"
that means failing @ line
filesystem.root.getfile("projectfilename", {create: create: true, exclusive: false}, gotfileentry, fail);
.
code snippet
function ondeviceready() { window.requestfilesystem(localfilesystem.persistent, 0, gotfs, fail); } function gotfs(fs) { filesystem = fs; filesystem.root.getfile("projectfilename", {create: create: true, exclusive: false}, gotfileentry, fail); } function gotfileentry(fe) { fileentry = fe; fileentry.createwriter(gotfilewriter, fail); } function gotfilewriter(writer) { .......... file writing code. } function fail(error) { alert('fail error code = '+error.code); alert('error '+error); console.log(error.code); }
the simulator avd 2.3.3 , device has android 2.3.6.
filesystem.root.getfile("projectfilename", {create: create: true, exclusive: false}, gotfileentry, fail);
to
filesystem.root.getfile("projectfilename", {create: true, exclusive: false}, gotfileentry, fail);
Comments
Post a Comment