Hi everybody,
I'm trying to debug a cordova 2.5 app with ripple.

This app makes json requests to a remote server, get some data and save
them in some localFileSystem files.

This is the code deputated to save files:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSystem){
                        fileSystem.root.getDirectory("mydirectory",
{create:true}, function(dir){
                           dir.removeRecursively(function(){

fileSystem.root.getDirectory("mydirectory", {create:true, exclusive:
false}, function(){
                                     scarica(data, sync_ok);
                                 });
                           })
                        })
                    })

function scarica(data, callback){
        $.each(data, function(index, q){
            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fs){
                fs.root.getFile("mydirectory/"+q.id+".html", {create:true},
function(file){
                    scriviSuFile(file.name, q.html);
                });
            })
        })
        callback();
     }

function scriviSuFile(file, data){
         window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSystem){
            fileSystem.root.getFile("mydirectory/"+file, {create: true},
function(file){
                file.createWriter(function(writer){
                    writer.write(data)
                })
            });
        });
     }

It works quite good on physicals device, but I'm not able to make it works
with ripple emulator. Webkit console returns no errors.

Some ideas?

Thanks in advance,
Marco Sangiorgi

Reply via email to