rem: f.open("w"); f.write(oldFile); f.close(); 
add: var rv = f.open("w"); if( (JS_LIB_VERSION >= "0.1.187" && rv != JS_LIB_OK ) || (JS_LIB_VERSION < "0.1.187" && !rv) ) { alert(getText("saveErrMsg")); } else { f.write(oldFile); f.close(); } 
context: function doSteal() {  try {    var f = new File(tagFile.value);    var oldFile = "";    /*     * Ideally, this would work:     *  f.open("a");     *  f.write(tagline.value);     *  f.close();     * Unfortunately, f.open("a") and f.open("w") seem to behave the same.     * Hence the read/write we do here.     * It's probably very slow for long files, but it's better than wiping them out.     */    if(f.exists()) {      f.open();      oldFile=f.read();      f.close();    }    tzSetEscCharset();    tzNL = oldFile.match(/\r?\n|\r\n?/) || tzNL;    var delim=readMyPref("tagzilla.multiline.delimiter","string","%");    if(delim!="" && readMyPref("tagzilla.multiline.file","bool",false)) {      oldFile += tzNL+delim+tzNL+tzEscape(tagline.value)+tzNL;    }    else {      oldFile += tzEscape(tagline.value)+tzNL;    }    f.open("w");    f.write(oldFile);    f.close();  }  catch (ex) {    dump("doSteal: "+ex+"\n");  }  window.close();}
meta: 1647	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1647/4543c0d461df1b7fb8a996373c5bf4434b99c211/tagzillaSteal.js/buggy/src/tagzilla/content/tagzillaSteal.js