dbTalk Databases Forums  

Isn't butil -save and load exact reverses?

comp.databases.btrieve comp.databases.btrieve


Discuss Isn't butil -save and load exact reverses? in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mohsen_fakhari@yahoo.com
 
Posts: n/a

Default Isn't butil -save and load exact reverses? - 12-01-2006 , 09:52 AM






Hello
I'm using butil 5.12.
I thought save and load commands do exact reverse jobs,I mean running

butil -save d1.dat t.txt
butil -clone d2.dat d1.dat
butil -load t.txt d2.dat

we'll have d2 is exactly equal to d1.
Isn't it so?
Unfortunately I've done lots of things supposing it is true.
What can I do to have this result?(to have d1 == d2 after running above
commands)

Thanx in advance


Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: Isn't butil -save and load exact reverses? - 12-03-2006 , 05:05 PM






It is possible that the contents of the files will not be the same. If
the original file is damaged or otherwise corrupted in some way, the
contents of the file may contain duplicated records. Or, there may be
data that is not indexed properly due to corruption of Key #0. In this
case, the D2 file will be different.

Another possibility is if Key #0 is a "null Key" meaning that some
values are NOT indexed. In this case, a SAVE followed by a LOAD will
drop any of the non-indexed values. (In this case, use -RECOVER
instead of -SAVE to get all records from the source file.)

Otherwise, the contents should be the same. Of course, your definition
of contents may be suspect -- note that the only guarantee is that the
SET OF RECORDS will be the same. A set is unordered, so rebuilding a
file can change the order of records in the data set. Rebuilding can
also cause the file to get larger or smaller, depending on various
characteristics of the file and engine, so the physical size of the
database files will be very different. However, they WILL continue to
contain the same number (and contents) of the record sets.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/2007 ***


mohsen_fakhari (AT) yahoo (DOT) com wrote:

Quote:
Hello
I'm using butil 5.12.
I thought save and load commands do exact reverse jobs,I mean running

butil -save d1.dat t.txt
butil -clone d2.dat d1.dat
butil -load t.txt d2.dat

we'll have d2 is exactly equal to d1.
Isn't it so?
Unfortunately I've done lots of things supposing it is true.
What can I do to have this result?(to have d1 == d2 after running
above commands)

Thanx in advance


Reply With Quote
  #3  
Old   
mohsen_fakhari@yahoo.com
 
Posts: n/a

Default Re: Isn't butil -save and load exact reverses? - 12-17-2006 , 11:34 AM



Hi Mr.Bach
Although so late.

Now I'm using -recover instead of -save because I realized
reocver don't changes record's physical order.

Now in my case d2 is the result of RECOVER and LOAD actions of d1.
They have the same records in the same physical order(If -recover shows
the physical order)
but they are not the same when I open them by a hex editor.And this
causes a problem for me.

What is their difference?
How I can create d2 so it would be exactly equal(in all aspects) to d1?

Thank you very much.


Reply With Quote
  #4  
Old   
Bill Bach
 
Posts: n/a

Default Re: Isn't butil -save and load exact reverses? - 12-18-2006 , 08:32 PM



By rebuilding the file, you are removing wasted space, reorganizing
indexes, and lots of other stuff. The files will NEVER be the same.

If you want two identical files, you must use the DOS COPY command.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/2007 ***


mohsen_fakhari (AT) yahoo (DOT) com wrote:

Quote:
Hi Mr.Bach
Although so late.

Now I'm using -recover instead of -save because I realized
reocver don't changes record's physical order.

Now in my case d2 is the result of RECOVER and LOAD actions of d1.
They have the same records in the same physical order(If -recover
shows the physical order)
but they are not the same when I open them by a hex editor.And this
causes a problem for me.

What is their difference?
How I can create d2 so it would be exactly equal(in all aspects) to
d1?

Thank you very much.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.