rem: var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE); 
add: var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE); 
context:   exportOPML: function()  {    if (this.mRSSServer.rootFolder.hasSubFolders)    {      var opmlDoc = document.implementation.createDocument("","opml",null);      var opmlRoot = opmlDoc.documentElement;      opmlRoot.setAttribute("version","1.0");      this.generatePPSpace(opmlRoot,"  ");      // Make the <head> element      var head = opmlDoc.createElement("head");      this.generatePPSpace(head, "    ");      var title = opmlDoc.createElement("title");      title.appendChild(opmlDoc.createTextNode(this.mBundle.getString("subscribe-OPMLExportFileTitle")));      head.appendChild(title);      this.generatePPSpace(head, "    ");      var dt = opmlDoc.createElement("dateCreated");      dt.appendChild(opmlDoc.createTextNode((new Date()).toGMTString()));      head.appendChild(dt);      this.generatePPSpace(head, "  ");      opmlRoot.appendChild(head);      this.generatePPSpace(opmlRoot, "  ");      //add <outline>s to the <body>      var body = opmlDoc.createElement("body");      this.generateOutline(this.mRSSServer.rootFolder, body, 4);      this.generatePPSpace(body, "  ");      opmlRoot.appendChild(body);      this.generatePPSpace(opmlRoot, "");      var serial=new XMLSerializer();      var rv = pickSaveAs(this.mBundle.getString("subscribe-OPMLExportTitle"),'$all',                          this.mBundle.getString("subscribe-OPMLExportFileName"));      if(rv.reason == PICK_CANCEL)        return;      else if(rv)      {        //debug("opml:\n"+serial.serializeToString(opmlDoc)+"\n");        var file = new LocalFile(rv.file, MODE_WRONLY | MODE_CREATE);        serial.serializeToStream(opmlDoc,file.outputStream,'utf-8');        file.close();      }    }  },
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/a726cf3bef215bac6d3c1797dc8acaf2e510466a/feed-subscriptions.js/clean/mail/extensions/newsblog/content/feed-subscriptions.js