File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Writing to the end of a file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Writing to the end of a file" Watch "Writing to the end of a file" New topic
Author

Writing to the end of a file

Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

Hello everyone and merry Christmas ( {eve day} depending on time zones etc)

I have a general quesiton. I am trying to design a logger class, and I want to close a log, and then reopen it later for the next issue, and [here is the key and the reason I am writing this today] write a brief description of the exception at the very end of the file. The question is, what class must I use in order to write the new lines at the very end of the existing file without going through the hassle of creating a tmp file, re-writing, et cetera, et cetera, et cetera?

Thanks in advance,

Greg
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2693

I found a useful related post for you.

But the idea is to use one of the java.io.Writer implementation and then use its append method.


Mohamed Sanaulla | My Blog
Greg Reeder
Ranch Hand

Joined: Jun 14, 2011
Posts: 99

Thank you! That little 'true' was all I needed. Thanks.
 
IntelliJ Java IDE
 
subject: Writing to the end of a file
 
Threads others viewed
MS 70-528 Discussion Forums?
HELP! DBCP configuraiton for Tomcat 5
Is this PetStore component imp: is efficient ?
Appending the data in frame or popup window
Unix Tutorials
developer file tools