Jump to content

Random Access Files in Java

Featured Replies

I was wondering if there is an easy way to check if RAF exist like with sequential files with the .exists() method.

 

I checked in the Java Sun website and apparently there isn't so the only thing that occured to me was to get the file pointer (getFilePointer()) and if it is null then the file doesn't exist.

 

Any suggestions?

I was wondering if there is an easy way to check if RAF exist like with sequential files with the .exists() method.

 

I checked in the Java Sun website and apparently there isn't so the only thing that occured to me was to get the file pointer (getFilePointer()) and if it is null then the file doesn't exist.

 

Any suggestions?

 

Here are two links that might help.

 

http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Supplements/Chapter09/randomAccess.html

 

http://java.sun.com/docs/books/tutorial/essential/io/rafs.html

 

If anything there is always exceptions, I mean there are entire families of them for anything software based, because they are not exceptions, just more programming:D

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.