<posted & mailed> Patrick Carabin wrote: ... > how do i have to manage it to keep the contents that are already in > the file ? Do You have some example? As I already posted, mode 'r+' is what you need if the file already exists, in order to keep its previous contents except when you specifically overwrite them ('r+b' if it's a binary-file). Alex