Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

save bug

 [1/7] from: rishi::picostar::com at: 15-Sep-2000 13:39


Here is a bug I found while programming rebol. do following in rebol shell:
>> obj: make object! [
[ f: "field" ]
>> save %shoot.txt obj
this will save a text file containing object in file shoot.txt. If you open shoot.txt, you will notice that the object is saved as follows: make object! [ m: "method" ] now enter the the last entry again into the command line:
>> save %shoot.txt obj
now if you open up shoot.txt, the object is saved as follows: make object! [...] This is incorrect. It did not save the object right and you can no longer retreive this object using load. So the basic bug is that if you save the same exact object to a file twice, the second time it doesn't work. Notice that if you alter the state of the object (such as set m to something else), and then save it, it will be saved correctly. This bug has been such a pain for me today!!!! Rishi

 [2/7] from: jimg:rebol at: 15-Sep-2000 14:07


What version are you using? The latest experimental builds don't seem to exhibit this behavior. - jim At 01:39 PM 9/15/2000 -0700, you wrote:

 [3/7] from: rishi:picostar at: 15-Sep-2000 14:34


about box says: rebol/view Version 0.10.29.3.1 running on win98SE I think it is latest view version... rishi

 [4/7] from: rishi:picostar at: 15-Sep-2000 14:52


another interesting thing you might want to know about this bug is... let's say you save an object to the same file n times (where n is any arbitrary number). But each time you save it, the object was in a different state (ie. a field in the object was different each time). The save will work fine. But if at any time after the object happens to be in the same state as any of those n earlier states, and then you save, this bug will occur and file will be corrupted.. Rishi

 [5/7] from: jimg:rebol at: 15-Sep-2000 15:04


Latest is 0.10.33.3.1. Give it a try. There were some fixes to the mold function. - jim At 02:34 PM 9/15/2000 -0700, you wrote:

 [6/7] from: al:bri:xtra at: 16-Sep-2000 10:18


> So the basic bug is that if you save the same exact object to a file
twice, the second time it doesn't work. Notice that if you alter the state of the object (such as set m to something else), and then save it, it will be saved correctly. It seems to work correctly for me. I can't duplicate your bug at all. Have you tried restarting Rebol? You may have accidentally redefined a important Rebol word. REBOL/View 0.10.33.3.1 10-Sep-2000 Copyright 2000 REBOL Technologies. All rights reserved.
>> obj: make object! [
[ f: "field" ]
>> save %shoot.txt obj >> print read %shoot.txt
make object! [ f: "field" ]
>> save %shoot.txt obj >> print read %shoot.txt
make object! [ f: "field" ]
>> save %shoot.txt obj >> print read %shoot.txt
make object! [ f: "field" ]
>> >> save %shoot.txt obj >> save %shoot.txt obj >> print read %shoot.txt
make object! [ f: "field" ] Andrew Martin ICQ: 26227169 http://members.ncbi.com/AndrewMartin/ http://members.xoom.com/AndrewMartin/

 [7/7] from: rishi:picostar at: 15-Sep-2000 21:51


sorry. I didn't realize that view has been updated. In addition, I was pleasantly surprised to find beta version of command available. new release solved bug. Now I can get continue on with my program ... thanks. Rishi