How to prevent file overwriting in processing? i am working on this arduino project using processing. There are some sensor values which should be logged, but unfortunately my processing code rewrites the file after each cycle so that i get the last sensor value only. How do i prevent this from happening? I am using the ordinary method by the way. PrintWriter command followed by createWriter
PrintWriter pw = new PrintWriter(new FileOutputStream(
    new File("persons.txt"), 
    true /* append = true */));

The true is the append mode flag.
Also check if you're using 

pw.append(p.toString());
        pw.append("sdf");

https://stackoverflow.com/questions/8210616/printwriter-append-method-not-appending