VoVa Vc
unread,Mar 25, 2012, 11:48:22 AM3/25/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phonegap
Hello everybody.
I have a very strange problem. My app needs to write a file, but
always gets the same error:
File error 9 (Invalid modification)
here is the code:
variables Lenapath & currentPos are paths to file
filenameS is variable that contains name of file, for examle
"text.txt"
function saveSCode(){
if(Lena==1){
window.resolveLocalFileSystemURI(Lenapath, gotFileEntryW, fail);
}
else{
var currentPos=$('#currentD').attr('name')
var currentName=$('#currentD').attr('data-entry')
currentPos=currentPos.replace(currentName, "")
window.resolveLocalFileSystemURI(currentPos, gotFileEntryW, fail);
}
}
function failing(error){
alert('Failing with error code '+error.code);
}
function gotFileEntryW(fileEntry){
var filenameS='"'+$("#filename").val()+'.'+$("#dim").val()+'"'
fileEntry.getFile(filenameS, {create: true, exclusive: true},
gotFileEntrySW, failing);//here is the error
}
function gotFileEntrySW(fileEntry){
fileEntry.createWriter(gotFileWriterW, fail);
}
function gotFileWriterW(writer) {
writer.write($("#codeText").val());
alert("contents of file now "+$("#codeText").val());
}
function fail(error) {
alert('Error code '+error.code);
}
There are also a console log error on app start:
03-25 19:24:42.276: I/Web Console(18224): JSCallback Error: Request
failed. at file:///android_asset/www/cordova-1.5.0.js:4244
I had googled this problem, but find out nothing. Please help with
this trouble.