• Post Reply Bookmark Topic Watch Topic
  • New Topic

filewriter problem...urgent...please help..

 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
can someone tell me if there is a way by which a filewriter deletes the entire contents of an existing file and start writing fresh from the 1st line of that file?basically in my applet i am using a couple of text files and i want that when the applet is destroyed then either the text files should be entirely deleted or at least their contents should be deleted in their entirety..please tell me how can this be done..
thanks a lot in advance
karan
PS- please help ASAP,its kinda urgent
 
Ryan Langley
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
probably the best thing for you to do is use the File class to wrap your file, and then pass that object to the FileWriter constructor. The File class has a lot of methods you will find useful. From createTempFile() to deleteOnExit(). Hope this helps!

------------------
Cheers,
RL
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!