rem: file.write ("# path, file, function, start-line, end-line, " + "call-count, recurse-depth, total-time, min-time, " + "max-time, avg-time\n"); };  function writeSummaryCSV(file, summary) { for (var i = 0; i < summary.length; ++i) { var r = summary[i]; file.write (r.path + ", " + r.file + ", " + r.fun + ", " + r.base + ", " + r.end + ", " + r.ccount + ", " + r.recurse + ", " + r.total + ", " + r.min + ", " + r.max + ", " + r.avg +"\n"); } 
add: var msg = getMsg(MSN_PROFILE_SAVED, getURLSpecFromFile(file.localFile)); display (msg); console.status = msg; file.close(); 
context: function cmdSaveProfile (e){    function writeHeaderCSV(file)    {        file.write ("# path, file, function, start-line, end-line, " +                    "call-count, recurse-depth, total-time, min-time, " +                    "max-time, avg-time\n");    };        function writeSummaryCSV(file, summary)    {        for (var i = 0; i < summary.length; ++i)        {            var r = summary[i];            file.write (r.path + ", " + r.file + ", " + r.fun + ", " + r.base +                        ", " + r.end + ", " + r.ccount + ", " + r.recurse +                        ", " + r.total + ", " + r.min + ", " + r.max +                        ", " + r.avg +"\n");        }    };            function writeSummaryText(file, summary, fileName)    {        file.write ((fileName ? fileName : "** all files **") + "\n");        for (var i = 0; i < summary.length; ++i)            file.write ("\t" + summary[i].str + "\n");    };        if (!e.targetFile || e.targetFile == "?")    {        var rv = pickSaveAs(MSG_SAVE_PROFILE, "$html *.csv $text $all");        if (rv.reason == PICK_CANCEL)            return null;        e.targetFile = rv.file;    }        var file = fopen (e.targetFile, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE);    var ary = file.localFile.path.match(/(csv|html?)$/i);    var writeHeader = null;    var writeSummary = writeSummaryText;    var writeFooter = null;    if (ary)    {        var ext = ary[1].toLowerCase();        if (ext == "csv")        {            writeHeader = writeHeaderCSV;            writeSummary = writeSummaryCSV;        }        else        {            writeHeader = writeHeaderHTML;            writeSummary = writeSummaryHTML;            writeFooter = writeFooterHTML;        }    }        if (writeHeader)        writeHeader(file);    var i;        if ("urlList" in e && e.urlList.length > 0 ||        "url" in e && e.url && (e.urlList = [e.url]))    {        for (i = 0; i < e.urlList.length; ++i)            writeSummary(file, console.getProfileSummary(e.urlList[i]),                         e.urlList[i]);    }    else    {        var scriptURLs = keys(console.scripts).sort();        for (i = 0; i < scriptURLs.length; ++i)        {            var fileName = console.scripts[scriptURLs[i]].fileName;            writeSummary(file, console.getProfileSummary(fileName), fileName);        }    }    if (writeFooter)        writeFooter(file);    display (getMsg(MSN_PROFILE_SAVED, getURLSpecFromFile(file.localFile)));    file.close();    return file.localFile;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c253059afafb09ee6b27e3767bb1e487e050ba0f/venkman-commands.js/clean/extensions/venkman/resources/content/venkman-commands.js