A few days ago Ralph wrote: >Now we get the database (i.e. textfile): > > a: read/lines %/catalog/booklist.txt > >You might want to put your datafile in a non-web accessible area of your >server just for security reasons, as I did above. > >Now, we have both the search term and the database to be searched in REBOL. >In my case, I have a text file with three kinds of lines--category names; >lines with title, author, isbn, publisher, price; and lines that contain >descriptions of books. I use loops and parsing to determine the type of line >and how to handle it for output back to HTML, letting the REBOL script >constuct the search results page. > >I should mention that your database, if large, can exceed memory space. Use >the technique: > > a: open/lines %textfile.txt > >This creates a port to the file instead of pulling the whole thing into >memory. Remember to close it when done. I'm working on a similar problem and I'm trying to minimize the use of memory resources on my web-server. Reading documentation I found that a: open/DIRECT/lines %textfile.txt works without buffering and it has to be used when you are accessing a very large file. But if you do, you can't work anymore on "a" as if it were a series. So I'd be very happy if someone could confirm that also "open/lines" itself doesn't load the whole file in memory... ;-) Greetings -- Paolo Russo [EMAIL PROTECTED] _________________ PERD s.r.l. Virtual Technologies for Real Solutions http://www.perd.com
