[REBOL] Re: Mutually Assured Backup
From: m:koopmans2:chello:nl at: 5-Aug-2001 8:22
Two parts in your problem:
1) encrypt / decrypt files locally, see the script library, crypt.r
2) putting / getting them
2) With rugby:
write to func's,
get-file: func [ name ]
[
return read/binary to-file name
]
put-file: func [ name content]
[
write/binary to-file name content
]
serve [ get-file put-file]
This will allow you to do
a: read %test.doc
rexec reduce [ 'get-file "test.doc" a ]
which should work. Rugby allows message sizes to 99,999,999 bytes, but it is
all in memory and does a compress before it sends. So for large files you
may want to send and read in parts of files,
with a func append-file and get-chunk or so.
A bit of experimenting with the above funcs and some files in different file
size should give you an idea what the max file / chunk size is (and please
let us know as well!), although it probably depends on your hardware
configuration as well.
If you use Rugby this way you get error handling and message integrity, and
if you have /Pro built-in security. I more or less put in the large message
size to help sending files (at least in parts), but I never had the time to
experiment with the maximum size. With a bit of fantasy you see how ease it
is to build the next Napster, Gnutella, Groove or so.....
--Maarten