• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hi

 
satya saha
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any body tell how to delete content of file but not file
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi satyasri ch welcome to Javaranch
Firstly please make you subject little descriptive. Read this for more information.
can any body tell how to delete content of file but not file


And if you want to delete the entire content of a file then just delete the file and make a new one with same name.

Please take some time to read the ask good questions link below.


Hope this helps
 
Rob Spoor
Sheriff
Pie
Posts: 20613
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or create a new FileOutputStream or FileWriter to the File (without the append flag) and close it immediately:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic