You are trying an inappropriate operation on an already existing file.
Recode your program to eliminate this mistake.