aspose file tools*
The moose likes Beginning Java and the fly likes hi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "hi" Watch "hi" New topic
Author

hi

satya saha
Greenhorn

Joined: Aug 08, 2008
Posts: 13
can any body tell how to delete content of file but not file
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2718
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19792
    
  20

Or create a new FileOutputStream or FileWriter to the File (without the append flag) and close it immediately:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hi