[REBOL] saving and loading objects - Bug in 'save Re:
doug edmunds wrote: I am stuck. I have followed along with the "Simple Database" contained in the Rebol how-to.html file, but I can't manipulate the header object that save/header load/header creates. I want to make changes and save the data back, with the header intact. This should work: save/header %cities2.r data header BUT it doesn't work correctly as there's a bug in 'save! Have a look at REBOL/View's help for 'save: help save USAGE: SAVE where value /header header-data DESCRIPTION: Saves a value or a block to a file or url. SAVE is a native value. ARGUMENTS: where -- Where to save it. (Type: file url) value -- Value to save. (Type: any) REFINEMENTS: /header -- Save it with a header header-data -- Header block or object (Type: block object) With the refinement /header and using an object, 'save saves the data like this: print read %cities2.r REBOL make object! [ Title: "City data" Date: none ; SNIP! Language: none User_Groups: "PDX Vanc" ] Note that "make object!" shouldn't be in the REBOL script file! Here's a quick example: h: make object! [ [File: %file.r [Date: 7/April/2000 [] data: [ [a: 1 [b: 2 [c: 3] == [ a: 1 b: 2 c: 3] save/header %file.r data h print read %file.r REBOL make object! [ File: %file.r Date: 7-Apr-2000 ] a: 1 b: 2 c: 3 Note that "make object!" shouldn't be in the 'save-ed file! CC-ed to feedback and to ally list. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] Newsletter via Procmail Re:
My web host supports REBOL and limited procmail but not SMTP (direct outgoing mail). Do a search in http://www.simtel.net/simtel.net/ . I've seen a program there that will act as a SMTP server on your local machine so that the ISP is not involved with sending the mail on their server.
[REBOL] Thanks for advice on: Salvaging ASCII data from binary file
Thanks to everyone who responded. I used Allen K's advice: good-chars: charset [#" " - #"/" #"0" - #"9" #"A" - #"Z" #"a" - #"z"] file: to-file ask "Filename? " data: read/binary file forall data [ if find good-chars first data [ write/append %good.txt to-string copy/part data 1 ] ] This worked fine. The file was an Access database (Jet Engine) which got corrupted when someone opened it in MS Word and overwrote it. Originally, it was thought someone put a password on it. Of course, the ASCII version looks like a mess, but the names, phone numbers, etc. are readable. Of course, these people didn't have a recent copy or backup of the file. Mark Evans suggested using Icon - which looks good; Michael Jelinek mentioned using "strings" if I had Unix (I'm using Win95; I do have the MKS toolkit, but not currently installed); Bob Paddock sent me a little program (strip.exe) to clean the file. Of course, Euphoria or Snobol4 would probably work well, too. Rebol seems the simplest - nice for a little job like this. Pete Geddes -- Peter H. Geddes; Savannah, Georgia USA mailto:[EMAIL PROTECTED] --
[REBOL] CGI secure WAS: CGI problem
Hello Ingo, #!rebol -cs REBOL[] secure [net quit] This would give all access to files, but none to the web. Well, I just tried to answer the question, in te way I understood it. I think GET should still be possible, I am not sure about PUT. (I have written one test cgi up to now, so am not exactly a profi in this field). Thinking about it, the better solution would be to add 'secure to %user.r, know you could be sure, that none of your cgi's ever sends a mail with your files attached, or something like that ... Uhm, but that would only count if you used your general Rebol for CGI, and on a web server, you usuallyu don't (I wouldn't!), my web server has Rebol in the /cgi-bin/ without a user.r, so it can't mail anyway... I will test the 'PUT' this weekend... (don't you mean POST?) Regards, Rachid
[REBOL] bug ? parse / space Re:(3)
Hello, When I use the '| operator (for OR), 'parse will search the entire string for the first pattern then, if this isn't found, it will begin searching for the second pattern. Although a person may want to do this, I do not. What I want is to match the first or second pattern, WHICHEVER COMES FIRST in the search string. Bummer, huh? I couldn't verify this (I only got 'true' returned, but that's obvious ;o), but I believe 'any is what does that precisely: a: "ads1dgfuihdf2iofj6pfg5idgfi6idfsgp7gfhi8" parse a [any ["5" "6"] to end] My mastery of parse doesn't extend to actually proving this, but I believe this means 'parse stops at the first of the two it encounters, just like you wanted, right? =) Regards, Rachid