phonegap plugins - Cordova multiple logging writes fail -


i'm writing log file function file on device. when write back entries, 1 of 2 saved file. getting pointer .seek call before each write, seems pointer not updated or file not being closed. have confirmed 2 events firing , external log file getting appended, missing 1 of entries.

here code:

function writethelog(str) {  if(!logob) return;   logob.createwriter(gotfilewriter, function(){alert('fail')});   function gotfilewriter(filewriter) {   filewriter.onwrite = function(evt) {     //alert("write success");     console.log("write success");     };      filewriter.onwriteend = function(evt) {   alert("write end");   console.log("write end");   };      filewriter.onerror = function(evt) {   console.log("write error"); };      filewriter.seek(filewriter.length); var blob = new blob([str], {type:'text/plain'}); filewriter.write(blob); }     

is there way async or force pointer update on each call?


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -