• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic