Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Delete data from random access file  RSS feed

 
Samir Patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am doing program with RandomAccessFile class. I can write data to file and can read data from file. Now, if I want to delete perticular data from file, then is it possible to delete that data from that file. I am really confuse with that.
Please help me to getout from this confusion.
Thank you very much,
Samir
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samir,
I'm not aware of any way that you can delete data from an existing file using RandomAccessFile or any other Java class. I believe that you'd have to create a new file that only contains the data you want to keep and replace the original file with the new one.
------------------
Brett Spell
Author, Professional Java Programming
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!