aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX:[URLyBird]Why db.db change to 0 KB ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX:[URLyBird]Why db.db change to 0 KB ?" Watch "NX:[URLyBird]Why db.db change to 0 KB ?" New topic
Author

NX:[URLyBird]Why db.db change to 0 KB ?

Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
Hello,every one
I would try to do some exercises for my assignment.
But some day,suddenly,I found that the db-1x3.db file change to 0 byte.
(And I ever read it for several times)
Thus,I have to copy the db file to overwrite it using another copy.
Could you please tell me the reason?
Regards,
Richard


Regards, Richard
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

Hi Richard,
Are you using a RandomAccessFile to access the file? Or some other class?
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
Hi,Andrew

Are you using a RandomAccessFile to access the file? Or some other class?

Yes,I just used RandomAccessFile class.The code shows as below,

The part of code runs commonly.
But when I was going to do other test applications,I found db-1x3.db file turns into 0 KB!!!
Why?
Regards,
Richard
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

Hi Richard,
I think you are saying that the code you posted works, and the file size does not change. That is what I would expect - there is nothing in the code you posted that should modify the file.
But when you use other code that you have not posted, the file size changes.
I am sorry I cannot comment on the other code.
I suggest you run each test application once, and verify whether the file size changes or not. When you determine which test application is causing the file to change, then you can look at that code and work out what is different from the code you posted.
Regards, Andrew
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX:[URLyBird]Why db.db change to 0 KB ?