• Post Reply Bookmark Topic Watch Topic
  • New Topic

about RandomAccessFile

 
Ramya Ramalingam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to finish my choices.txt.Now I have lots questions in mind.
RAF opens the specified file,if not one it creates one(as my understanding..).I am not sure we have to create one.Is it one when the IOException is thrown,when trying to read the empty file.Since there is no specific reason for IOexception....can anybody help me how you handled this?


Thanks,
Ramya.
 
Roel De Nijs
Sheriff
Posts: 10763
148
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the file does not exist, I throw an exception. This exception propagates back to the client and it is shown to the user (and then the application exits). A very simple and easy approach. No valid database file, no application (standalone client or network server).
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!