Computer Science Canada

PrintWriter deletes contents of file

Author:  Justin_ [ Thu Apr 27, 2006 8:32 pm ]
Post subject:  PrintWriter deletes contents of file

code:

PrintWriter output = new PrintWriter(new FileWriter(inputFile));


How do i make it open the file for writing without deleting the contents of the file?

Author:  Justin_ [ Thu Apr 27, 2006 8:36 pm ]
Post subject: 

Please whatever you do, don't suggest that I copy the contents of the file in an array first.

Author:  wtd [ Thu Apr 27, 2006 9:46 pm ]
Post subject: 

You're trying to "append" to the file. The FileWriter class makes this quite easy to do.


: