File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 2709
    
    5

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: 19538
    
  16

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
 
Similar Threads
Creating a file by giving relative path
java io
Struts FormFile (parsing .csv files)
performance issues with file read and write
WA #1.....word association