I think I've solved by myself.

Actually I've written code that checks if the flle already exists in the 
memory file system.
Something like:


      function fileExistsInMemoryFS(path) {
>         var statbuf = FS.stat(path);
>         if (!statbuf) return false;
>         return FS.isFile(statbuf.mode);
>       }
>

And then before calling FS.createDataFile(...) I do something like:

        try {
>            if (fileExistsInMemoryFS('/'+e.target.current_file_name)) 
> FS.unlink('/'+e.target.current_file_name);          
>        }
>        catch(err) {
>         //document.getElementById("saveFileToMemoryFS").innerHTML = 
> err.message;
>         }
>

 
It seems to work (at least on Firefox).

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to