aspose file tools*
The moose likes Beginning Java and the fly likes problem in appending contents of file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem in appending contents of file." Watch "problem in appending contents of file." New topic
Author

problem in appending contents of file.

Puneet Mittal
Ranch Hand

Joined: Dec 18, 2007
Posts: 45

hi i am using the below constructor to create a file and then writing a text in it. now after that i am using a new constructor to append the same file "puneet.html", but the output file created is blank file.please tell me how to append the contents of a file properly.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

The quick solution ll be,
close() the first instance of your file, and then see !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 350
Sorry for my ignorance, but where did you find the constructor FileWriter(String, boolean) ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
Originally posted by Gamini Sirisena:
Sorry for my ignorance, but where did you find the constructor FileWriter(String, boolean) ?


It's listed in the javadocs of the FileWriter class, like all constructors.


Ping & DNS - my free Android networking tools app
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 350
Umm.. that's the problem. I checked http://java.sun.com/javase/6/docs/api/
before posting and I can't find such a constructor, what am I missing here?
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 350
Ok ok got it...
Silly me I had clicked the FilterWriter class in the API doc
 
wood burning stoves
 
subject: problem in appending contents of file.