This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Richard Jackson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11944
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Richard,
Are you using a RandomAccessFile to access the file? Or some other class?
Regards, Andrew
 
Richard Jackson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11944
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic