With a FileReader:BufferedReader, I need to del file contents and start logging again. Is there a really simple way to do this that I am missing?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thomas_Stidham
Posted On:   Wednesday, April 11, 2001 12:32 PM

I have a: BufferedReader inLine = new BufferedReader(new FileReader("supptLog.txt")); .... Psuedo: Is date in fileHeader today? -yes, append to present log. -no,. Remove contents (delete file somehow?). Put in new Header. Continue logging. Is there a really simple way to do the content removal or file deletion that I am missing?

Re: With a FileReader:BufferedReader, I need to del file contents and start logging again. Is there a really simple way to do this that I am missing?

Posted By:   mark_webb  
Posted On:   Thursday, April 12, 2001 07:04 AM

Use RandomAccessFile instead of BufferedReader/FileReader. Then RandomAccessFile.setLength(0) will set the file size to zero.
About | Sitemap | Contact