• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic