>>3-4
最終的に何がしたいかによる。と言うか、インタフェース名で検索すれば割とヒットするはずなんだが(以下は http://d.hatena.ne.jp/nitsuji/20061220
を参考にした)。
function writeToFile (filePath, content) {
try {
netscape.security.PrivilegeManager.enablePrivilege ('UniversalXPConnect');
var file = Components.classes["@mozilla.org/file/local;1"].createInstance (Components.interfaces.nsILocalFile);
file.initWithPath (filePath);
if (! file.exists ()) file.create (0, 0664);
var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance (Components.interfaces.nsIFileOutputStream);
out.init (file, 0x20 | 0x02, 00004, null);
out.write (content, content.length);
out.flush ();
out.close ();
} catch (e) {
throw e;
}
}
writeToFile ('C:\\test.txt', 'TEST\n'); // for Win
http://developer.mozilla.org/en/docs/XPCOM
http://lxr.mozilla.org/mozilla/source/xpcom/io/
http://xulplanet.jp/xultu/
http://piro.sakura.ne.jp/xul/tips/x0021.html
「Web ページ製作」という掲示板の主旨からは幾分外れているので、XUL 関係のコミュニティを探した方が良いと思う。