in reply to RE: File Input and Output
in thread File Input and Output

of course it will create a new file. since you have opened it in write will open a new file and write data into it. if the file had already existed it would have removed the whole existing data and just put in data you just wrote. to prevent this open in >> mode