• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in appending contents of file.

 
Puneet Mittal
Ranch Hand
Posts: 45
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The quick solution ll be,
close() the first instance of your file, and then see !
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for my ignorance, but where did you find the constructor FileWriter(String, boolean) ?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok ok got it...
Silly me I had clicked the FilterWriter class in the API doc
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic