• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

java file qustion

Well, if you mean using the java.io.RandomAccessFile then the answer is: Ok....

Only you can answer that question. It all depends on how you built it. But in most cases, yes you have to write over it, because if you remove those bytes, it would probably screw up the structure.

Simply writing some "garbage" of the same type will do. Just as long as you remember to check when you read if what you are getting is that famed "garbage".

Good luck!

Edit: I think I get what you're saying. Sorry if what I wrote above doesn't help you.

If you mean "how to delete an entire record then the answer is, you have to rewrite your entire file.

Load up the structure up in your app, modify it as you wish, then rewrite the file from scratch.

I don't think there's a way to remove something that would be in the middle.
 
thanks for the reply.
i thought of both of thoes ways, rewriting the whole file seemed wastefull but i guess its better than having heaps of garbage fields in the file.
 
Good news!

I found something that may very well do what you want to do.

Go check out java.nio.channels.FileChannel class. It's part of the new java IO of 1.4. Inside you have a method called "truncate(long)" which does exactly what you want it to do.

All you have to do to get a hold of that class is to call from RandomFileAccess a method called "getChannel()"

I hope this will be of better use to you.
 
Back
Top