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

Object "Serialization" (script repost)

 [1/5] from: rgombert::essentiel::net at: 23-Feb-2001 0:59


Sorry... a few errors in the "comments" inside the script and the lack of indentation (due to outlook conersion of tabs to spaces), so I repost the script: REBOL [ Title: "Nom du script" File: %binutils.r Date: 22-Feb-2001 Author: "Renaud GOMBERT" Purpose: "Save and retrieve any word/value pair as binary" To-do: { Make a refinement to do compressions only if needed Allow processing of multiple word/value pairs at one time } Release: 0.0.1 Category: [] ] put-bin: func [ "Save word/value pair as compressed binary" 'data [any-type!] "word to process" filename [file!] "file to write to" /local temp ][ temp: make object! [ value: get data name: data ] write/binary filename compress to-binary mold temp ] get-bin: func [ "Load word/value pair from a compressed binary" filename [file!] "file to get word/value from" /local temp ][ temp: do decompress read/binary filename set temp/name temp/value ] Renaud GOMBERT email : [rgombert--essentiel--net] ICQ# 2602184

 [2/5] from: gjones05:mail:orion at: 22-Feb-2001 18:49


From: Renaud
> REBOL [ > Title: "Nom du script"
<<quoted lines omitted: 27>>
> set temp/name temp/value > ]
Thanks, Renaud. The compression seems to start paying dividends at original file length of mid 100's. You have reminded me that REBOL has the built-in compression. I guess that at least on Windows, numerous objects would be best saved in a single, easily parsable file inorder to avoid the unused sector space. I guess it is time to check-out Gabriele Santilli's database in this regard, or I could just reinvent the wheel. Now let's see (2 * pi * r) = .... :) --Scott

 [3/5] from: rgombert:essentiel at: 23-Feb-2001 10:38


From: "GS Jones" <[gjones05--mail--orion--org]> To: <[rebol-list--rebol--com]> Sent: Friday, February 23, 2001 1:49 AM Subject: [REBOL] Re: Object "Serialization" (script repost)
> ....... I guess that at least on Windows, numerous > objects would be best saved in a single, easily parsable file inorder to > avoid the unused sector space .......
You're right Scott, the compression mode is only suitable for pretty big objects, or collection of smaller ones ;-) I think the main interest is not only to (eventualy) save disk space, but also to save things in a non human-readable way. Script as published allow now saving of multiple "object" in one single file... but i still continue to improve it. The last one (not posted) return true if word/values file have been successfuly created and false otherwise, and when you get-bin it return the list of loaded and created word/value pairs (false otherwise). I don't want to spamm the list with new versions of this script anymore, but i'll send new versions of the script to anybody asking me. Renaud ICQ#2602184

 [4/5] from: sharriff:aina:med-iq at: 23-Feb-2001 9:53


You could keep me posted on this issue Renaud.. Regards Sharriff Aina med.iq information & quality in healthcare AG "Renaud" <[rgombert--esse] An: <[rebol-list--rebol--com]> ntiel.net> Kopie: Gesendet von: Thema: [REBOL] Re: Object "Serialization" (script repost) [rebol-bounce--r] ebol.com 23.02.01 09:38 Bitte antworten an rebol-list From: "GS Jones" <[gjones05--mail--orion--org]> To: <[rebol-list--rebol--com]> Sent: Friday, February 23, 2001 1:49 AM Subject: [REBOL] Re: Object "Serialization" (script repost)
> ....... I guess that at least on Windows, numerous > objects would be best saved in a single, easily parsable file inorder to > avoid the unused sector space .......
You're right Scott, the compression mode is only suitable for pretty big objects, or collection of smaller ones ;-) I think the main interest is not only to (eventualy) save disk space, but also to save things in a non human-readable way. Script as published allow now saving of multiple "object" in one single file... but i still continue to improve it. The last one (not posted) return true if word/values file have been successfuly created and false otherwise, and when you get-bin it return the list of loaded and created word/value pairs (false otherwise). I don't want to spamm the list with new versions of this script anymore, but i'll send new versions of the script to anybody asking me. Renaud ICQ#2602184

 [5/5] from: g:santilli:tiscalinet:it at: 23-Feb-2001 18:50


Hello GS! On 23-Feb-01, you wrote: GJ> unused sector space. I guess it is time to check-out Gabriele GJ> Santilli's database in this regard, or I could just reinvent GJ> the wheel. That would not save you space, it's still too naive. But as soon as we get the new port modes promised for /Core 2.5 I could update dbms.r and make it much better... Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted