When you open the file in append mode it always writes to the end of the file and not where the FILE_POINTER