Marek Lewczuk wrote:
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("c:\file.txt");
file.create(file.NORMAL_FILE_TYPE, 0644);
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var uri = ioService.newFileURI(file);
var channel = ioService.newChannelFromURI(uri);
var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
outputStream.init(file, 0x20|0x02, 00004, null); var buffer = request.responseText;
outputStream.write(buffer, buffer.length);
As said, that method is the problem as far as I understand from earlier comments, it is not suitable to be used with script to write multiple byte encoded characters to a file. I am not sure there is an adequate replacement exposed to script in Mozilla.
--
Martin Honnen
http://JavaScript.FAQTs.com/
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom
