Js, Javascript , Annoying Latency when creating a little file

djlbe's icon

Hi !

For an unknown reason, writing a file using javascript causes 3-4 seconds of freeze.
but my code seems good :
function save_recent_file() {
    f = new File (file_path, "write");
    if (f.isopen) {
        for (var i = 0; i < tbl.length ; i++)
            f.writeline(tbl[i]);
        f.eof = f.position;
        f.close();
    } else {
        post("Error : could not open " + file_path);
    }
}

the size of tbl is very short, about five index.
Any idea ?

djlbe's icon

it seems that, the problem occurs because i'm trying to write the file in the ressource Max 7 folder ...