Jump to content

Random Access Files in Java


clarisse

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

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.