.. scusate ma non ho afferrato il problema ..
non riesci a fare una scrittura sequenziale, cioè sovrascrivi quando dovresti "appendere"?