I would need to add data to a text file from javascript. I've found the following code :
var file = showFilePicker(window, "", Components.interfaces.nsIFilePicker.modeSave, "", function(fp) {return fp.file;});
var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance( Components.interfaces.nsIFileOutputStream);
outputStream.init(file, 0x02 | 0x08 | 0x20, 0644, 0);
outputStream.write(someText, someText.length);
outputStream.close();
However it takes a file chosen by the user thanks to a file picker. In my case, I'd like to write to a text file identified by its URL (for example : C://.../text.js)