Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Deleting Random Access Files  RSS feed

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i delete a random access file (or clear the file to start from the top again as if like new)?

Cheers
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RandomAccessFile has a setLength() method; setLength(0) will truncate the file to zero length.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!